[Zope-dev] ZCatalog: updateMetadata and comparing string and unicode

Benji York benji at zope.com
Thu Mar 6 13:53:10 EST 2008


Dieter Maurer wrote:
>      "sys.setdefaultencoding" is only available at startup.
>      Thus, setting "defaultencoding" must happen in a "sitecustomize"
>      or "site" module.

Or if you're sufficiently devious, it's available any time (not that 
actually using it is a good idea, but...):

 >>> import sys
 >>> sys.setdefaultencoding
Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
AttributeError: 'module' object has no attribute 'setdefaultencoding'
 >>> del sys.modules['sys']
 >>> import sys
 >>> sys.setdefaultencoding
<built-in function setdefaultencoding>

-- 
Benji York
Senior Software Engineer
Zope Corporation


More information about the Zope-Dev mailing list