Author vstinner
Recipients akira, ezio.melotti, loewis, peter0, terry.reedy, vstinner
Date 2014-03-25.13:46:08
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1395755168.56.0.491529798723.issue19264@psf.upfronthosting.co.za>
In-reply-to
Content
>  The original issue was reported against 2.7

Oh... Ok :-)

It's tricky to fix this issue in Python 2.7 because you have to choose which function is used: CreateProcessA() (bytes) or CreateProcessW() (Unicode). To use CreateProcessW(), you have to decode bytes parameter. Python 3 has os.fsencode()/os.fsdecode() functions, similar functions in C. The "mbcs" Python codec is strict by default, but it now supports any Python error handler. This change changed was improved in each Python 3 release.

Python 2 has PyUnicode_DecodeMBCSStateful() and PyUnicode_EncodeMBCS() which use the default Windows behaviour. I'm not sure that using PyUnicode_DecodeMBCSStateful() (or directly MultiByteToWideChar) + CreateProcessW() is exactly the same than calling CreateProcessA().

Should we support CreateProcessA() and CreateProcessW(), and use one or the other depending on the type of the pararameters?

IMO such change requires too much work and it is not enough to have a full Unicode support for filenames. You have to fix much more code. I already did all this work in Python 3 (in 3.1, 3.2 and then 3.3). I suggest you to upgrade to port your application to Python 3 if you want a full Unicode support. Using Unicode in Python 3 is natural and just works fine.

So I still suggest to close this issue as wontfix.

--

Similar discussions on Python 3:
http://bugs.python.org/issue8393#msg103565
http://bugs.python.org/issue8514#msg104224
History
Date User Action Args
2014-03-25 13:46:08vstinnersetrecipients: + vstinner, loewis, terry.reedy, ezio.melotti, akira, peter0
2014-03-25 13:46:08vstinnersetmessageid: <1395755168.56.0.491529798723.issue19264@psf.upfronthosting.co.za>
2014-03-25 13:46:08vstinnerlinkissue19264 messages
2014-03-25 13:46:08vstinnercreate