[Python-Dev] Adding the 'path' module (was Re: Some RFE for review) (original) (raw)

Neil Hodgson nyamatongwe at gmail.com
Sat Jul 9 05:50:52 CEST 2005


Thomas Heller:

But adding u'\u5b66\u6821\u30c7\u30fc' to sys.path won't allow to import this file as module. Internally Python\import.c converts everything to strings. I started to refactor import.c to work with PyStringObjects instead of char buffers as a first step - PyUnicodeObjects could have been added later, but I gave up because there seems absolute zero interest in it.

Well, most people when confronted with this will rename the directory to something simple like "ulib" and continue.

I can't judge on this - but it's easy to experiment with it, even in current Python releases since sys.argvu, os.environu can also be provided by extension modules.

It is the effect of this on the non-unicode-savvy that is important: if os.environu goes into prereleases of 2.5 then the only people that will use it are likely to be those who already try to keep their code unicode compliant. There is only likely to be (negative) feedback if existing features are made unicode-only or use unicode for non-ASCII.

But thanks that you care about this stuff - I'm a little bit worried because all the other folks seem to think everything's ok (?).

Unicode is becoming more of an issue: many Linux distributions now install by default with a UTF8 locale and other tools are starting to use this: GCC 4 now delivers error messages using Unicode quote characters like 'these' rather than `these'. There are 131 threads found by Google Groups for (UnicodeEncodeError OR UnicodeDecodeError) and 21 of these were in this June. A large proportion of the threads are in language-specific groups so are not as visible to core developers.

Neil



More information about the Python-Dev mailing list