Message51081
This patch modifies the import mechanism to fully
support unicode pathnames on Windows. It does this by
first converting each member of sys.path to utf-8.
strings are encoded using the current locale.
The whole of the import logic is then unchanged and
works on the utf-8 strings as though they were regular
ascii strings in the current locale.
Only when file operations are done, such as stat() and
open(), do we then convert from utf-8 back to unicode
and use the Windows unicode APIs for the job. This is
also done when initializing Module objects.
This approach has the benefit of being of having a low
impact on the importing logic, and is thus easy to
verify. There is however some overhead with the
conversions.
At CCP games we used this approach, backported to
python 2.3, to get unicode imports working for our
game, EVE Online, and thereby solving installation
issues in the far east.
This patch is submitted as demonstration code to the
python community. I would like to see unicode fully
supported in 2.6.
Cheers,
Kristján |
|
Date |
User |
Action |
Args |
2007-08-23 15:54:33 | admin | link | issue1552880 messages |
2007-08-23 15:54:33 | admin | create | |
|