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

Antoine Pitrou solipsis at pitrou.net
Tue Sep 29 17:33:19 CEST 2009


> I've also encountered this trap multiple times. Obviously, the problem
> is not rebuilding Python which is quick, but to figure out the correct
> configure option to use (--enable-unicode=ucs4). Others have also
> spent some time scratching their heads over the strange
> PyUnicodeUCS4_FromUnicode error the misconfiguration results in, as
> Zooko's links show.

Isn't this overrated?

First, if you have a Python version that has the wrong version, just print out
its sys.maxunicode and choose the right version according to that (if
sys.maxunicode == 65535, you need to compile an UCS-4 version, otherwise an
UCS-2 version).

Second, once you have encountered this issue, you know what you need the
subsequent times. There are only two possibilities after all.

> If Python can't infer the unicode setting from the width of the
> platforms wchar_t, then perhaps it should be mandatory to specify to
> configure whether you want UCS2 or UCS4? For someone clueless like me,
> it would be easier to deal with the problem upfront than (much)
> further down the line.

I'm not sure why someone "clueless" (your word :-)) wants to compile his own
Python, though.



More information about the Python-Dev mailing list