James Teh added the comment:

This issue is much nastier than it seems when dealing with character sets that 
contain multi-byte characters in Python 2.7 on Windows. For example, on a 
Japanese system:
1. The ANSI code page is cp932 and Python 2.7 will return the TEMP environment 
variable as a str with this encoding.
2. If a user has a username containing the character \u5c71, this will be 
encoded as \x8eR, so the TEMP environment variable will include this character.
3. When normcase is called, \x8eR is converted to \x8er.
4. Because \x8eR is a multi-byte character, \x8er is an unrelated character; 
case insensitivity for "R" doesn't apply.
5. The result is that the correct temp directory is skipped. In fact, on most 
systems, IOError is raised because none of the other candidate directories are 
valid either.

----------
nosy: +jteh

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14255>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to