[Python-Dev] please consider changing --enable-unicode default to ucs4

Antoine Pitrou solipsis at pitrou.net
Sun Sep 20 18:36:03 CEST 2009

Le Sun, 20 Sep 2009 10:17:45 -0600, Zooko O'Whielacronx a écrit :
>> AFAIK, C extensions should fail loading when they have the wrong UCS2/4
>> setting.
> That would be an improvement!  Unfortunately we instead get mysterious
> misbehavior of the module, e.g.:
> http://bugs.python.org/setuptools/msg309
> http://allmydata.org/trac/tahoe/ticket/704#comment:5

The bug reports in themselves aren't very explicit, and they don't seem 
to be related to any native extension. So I'm not sure why you're talking 
about "mysterious memory corruption errors" in your original mail, 
because there doesn't seem to be such a thing happening at all.

Please note that there's a bug related to a non-portable peephole 
optimization of some unicode constants, perhaps it may explain the 
aforementioned problems (perhaps not) :

I expect the solution to this bug to be rather easy (just disable the 
optimization, since it isn't really useful), but someone has to care 
enough to produce a patch.

>> For information, all Mandriva versions I've used until now have had
>> their Python's built with UCS2 (maxunicode == 65535).
> Thank you for the data point.  This means that binary extension modules
> built on Mandriva can't be ported to Ubuntu or vice versa.

"Ported" they can certainly be, you just have to recompile.

> However, is
> this an argument for or against changing the default setting to UCS4? 
> Changing the default setting wouldn't interfere with Mandriva's
> decision, right?

Well, let's put it this way:
- either you expect the default setting to be observed by everyone, and 
it *will* interfere with someone's current decision
- or you don't expect the default setting to be observed by everyone, and 
then there's no point in changing it because it won't stop your problems

Either way, my mentioning of Mandriva was just meant as an additional 
data point to those you already provided ;-)



More information about the Python-Dev mailing list