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

Florent Guillaume fg@nuxeo.com
Fri, 17 Jan 2003 16:16:34 +0100


In article <200212271839.gBRIdj408002@cvs.baymountain.com> you write:
> 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")

Why is that? Is this only temporary until we have Unicode encoding in URLs?
>From my understanding of the discussions we had sometime ago, it is
imperative to allow any Unicode character (except '/') in a name.

Jim agreed with that point of view, see
http://lists.zope.org/pipermail/zip/2002-May/000155.html

(Same question for zope/app/container/sample.py).

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)
+33 1 40 33 79 87  http://nuxeo.com  mailto:fg@nuxeo.com