E. Frerich <[EMAIL PROTECTED]> wrote:
> line 545 of zope\app\container\contained.py contains a testcase
> ">>> setitem(container, container.__setitem__, 'hello ' + chr(200), item)"
> which should give back a traceback:
> "    Traceback (most recent call last):
>     ...
>     TypeError: name not unicode or ascii string
> "
> but the name parameter is correct:
> "
> >>> max=unicode('hello ' + chr(200))

That shouldn't work. You're running with a non-default system default
encoding. In default systems, you'll get:

>>> unicode('hello'+chr(200))
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc8 in position 5: ordinal 
not in range(128)

Which is the correct answer, because chr(200) is a byte and not a
character per se, and cannot be converted to unicode with additional
information (its encoding).

Florent

-- 
Florent Guillaume, Nuxeo (Paris, France)   CTO, Director of R&D
+33 1 40 33 71 59   http://nuxeo.com   [EMAIL PROTECTED]
_______________________________________________
Zope3-dev mailing list
Zope3-dev@zope.org
Unsub: http://mail.zope.org/mailman/options/zope3-dev/archive%40mail-archive.com

Reply via email to