[Zope3-dev] Re: str to unicode promotion test failures (with patch)

Tres Seaver tseaver at zope.com
Wed Oct 13 22:59:11 EDT 2004


Osvaldo Santana wrote:
> On Wed, 13 Oct 2004 17:04:11 +0200, Martijn Faassen <faassen at infrae.com> wrote:
> 
>>Tres Seaver wrote:
>>
>>>I'll bet you have a 'sys.setdefaultencoding' in your Python's site.py;
>>>try rerunning the test without it, and see if it fails.
>>
>>If so, please note:
>>
>>sys.setdefaultencoding is evil and should never be used under any
>>circumstances.

Note that this is Guido's opinion, as well:

   http://aspn.activestate.com/ASPN/Mail/Message/i18n-sig/581409

> 
> Yes, I have. :/
> 
> My Linux distribution apply a patch to set my default encoding with
> locale.getdefaultlocale()[1] (ISO8859-1).
> 
> Anyway, its probabily will cause problems with Zope in other Python
> distributions no?

The accepted wisdom among the Zope community is *never* to use the 
"stock" Python bundled with your distro for running Zope in production; 
  the chance that the packager messed up something (stack size on 
FreeBSD, using 4-byte Unicode on RedHat, an inappropriate Python 
version, lack of large file support, or your encoding issue here) is too 
big, and you usually can't fix it without risking breaking something 
else in the distro.  Note that if you depend on the packaged Python, 
your app can break because the distro ships an updated, now incompatible 
version, and you won't know why until much later, usually after 
significant hair loss.

Instead, compile Python separately, (e.g., in '/opt', or '/usr/local') 
and use that version to build / compile Zope.

In the meanwhile, you can try filing a bug with your distro's packager; 
  I wouldn't expect that to do much good, however.

Tres.
-- 
===============================================================
Tres Seaver                                tseaver at zope.com
Zope Corporation      "Zope Dealers"       http://www.zope.com



More information about the Zope3-dev mailing list