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
Zope-Dev maillist  -
**  No cross posts or HTML encoding!  **
(Related lists - )

Reply via email to