[Zope-Checkins] CVS: Zope2 - ObjectManager.py:1.131.2.6

Andreas Jung andreas@dhcp165.digicool.com
Wed, 4 Apr 2001 15:39:26 -0400


Update of /cvs-repository/Zope2/lib/python/OFS
In directory yetix:/work/zope/Zope2_FTP/lib/python/OFS

Modified Files:
      Tag: ajung_Zope2_FTP_globbing_patch
	ObjectManager.py 
Log Message:
Modified Objectmanager to handle filenames during import with Latin1
characters



--- Updated File ObjectManager.py in package Zope2 --
--- ObjectManager.py	2001/04/02 18:54:08	1.131.2.5
+++ ObjectManager.py	2001/04/04 19:39:24	1.131.2.6
@@ -104,6 +104,7 @@
 from zLOG import LOG, ERROR
 import string
 import sys,fnmatch,copy
+import translationset
 
 import XMLExportImport
 customImporters={
@@ -127,9 +128,7 @@
     # set to false before the object is added.
     if not id or (type(id) != type('')):
         raise BadRequestException, 'Empty or invalid id specified.'
-    if bad_id(id) != -1:
-        raise BadRequestException, (
-            'The id "%s" contains characters illegal in URLs.' % id)
+
     if id[0]=='_': raise BadRequestException, (
         'The id "%s" is invalid - it begins with an underscore.'  % id)
     if id[:3]=='aq_': raise BadRequestException, (
@@ -270,8 +269,10 @@
         return default
 
     def _setObject(self,id,object,roles=None,user=None, set_owner=1):
-        v=self._checkId(id)
-        if v is not None: id=v
+
+        self._checkId(id)
+        id=translationset.filename2objectID(id)
+        
         try:    t=object.meta_type
         except: t=None