[issue20042] Python Launcher, Windows, fails on scripts w/ non-latin names

eryksun report at bugs.python.org
Tue Aug 19 13:12:24 CEST 2014


eryksun added the comment:

The problem is skip_whitespace mistakenly calls isspace instead of iswspace. 

http://hg.python.org/cpython/file/c0e311e010fc/PC/launcher.c#l48

isspace has undefined behavior when the argument is "not EOF or in the range of 0 through 0xFF":

http://msdn.microsoft.com/en-us/library/y13z34da%28v=vs.100%29.aspx

The display of debug messages should be handled in its own issue. IMO, setting stderr to _O_WTEXT mode or _O_U16TEXT mode looks reasonable. The launcher already uses wide-character strings and the wprintf family. It's just the default _O_TEXT mode ends up encoding to the console codepage. 

Regarding msg206744, %s in wide-character format strings is OK for VC++ 10:

http://msdn.microsoft.com/en-us/library/hf4y5e3w%28v=vs.100%29.aspx

This will be a legacy mode in VC++ 14 (CPython 3.5?): 

http://blogs.msdn.com/b/vcblog/archive/2014/06/18/crt-features-fixes-and-breaking-changes-in-visual-studio-14-ctp1.aspx

P.S.
In case someone wants an easy issue, I noticed a bug. There should only be one %s in the format string that starts on line 262:

http://hg.python.org/cpython/file/c0e311e010fc/PC/launcher.c#l262

----------
nosy: +eryksun

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue20042>
_______________________________________


More information about the Python-bugs-list mailing list