[Zope3-checkins] CVS: Zope3/src/zope/app/content - folder.py:1.3

R. David Murray bitz@bitdance.com
Fri, 27 Dec 2002 13:39:45 -0500


Update of /cvs-repository/Zope3/src/zope/app/content
In directory cvs.zope.org:/tmp/cvs-serv7983

Modified Files:
	folder.py 
Log Message:
Fix for bug revealed by improved IContainer unit test: make sure
name does not contain any non-ASCII characters if it passes
the string test.


=== Zope3/src/zope/app/content/folder.py 1.2 => 1.3 ===
--- Zope3/src/zope/app/content/folder.py:1.2	Wed Dec 25 09:12:48 2002
+++ Zope3/src/zope/app/content/folder.py	Fri Dec 27 13:39:45 2002
@@ -79,6 +79,9 @@
         if not (isinstance(name, str) or isinstance(name, unicode)):
             raise TypeError("Name must be a string rather than a %s" %
                             name.__class__.__name__)
+        try: unicode(name)
+        except UnicodeDecodeError:
+            raise TypeError("Name may not contain non-7-bit-ascii codes")
         if not name:
             raise TypeError("Name must not be empty")