Author vstinner
Recipients amaury.forgeotdarc, vstinner
Date 2010-05-20.12:39:43
SpamBayes Score 1.25653e-07
Marked as misclassified No
Message-id <1274359185.11.0.074282195914.issue8776@psf.upfronthosting.co.za>
In-reply-to
Content
> The wchar_t strings themselves are built with mbstowcs(), 
> the file system encoding is not used.

Oops sorry, you are right, and it's worse :-) sys.argv is decoded using the locale encoding, but subprocess & cie use the file system encoding for the reverse operation. => it doesn't work if both encodings are different (#4388, #8775).

The pseudo-code to create sys.argv on Unix is:

 # argv is a bytes list
 encoding = locale.getpreferredencoding()
 sys.argv = [arg.decode(encoding, 'surrogateescape') for arg in argv]
History
Date User Action Args
2010-05-20 12:39:45vstinnersetrecipients: + vstinner, amaury.forgeotdarc
2010-05-20 12:39:45vstinnersetmessageid: <1274359185.11.0.074282195914.issue8776@psf.upfronthosting.co.za>
2010-05-20 12:39:43vstinnerlinkissue8776 messages
2010-05-20 12:39:43vstinnercreate