This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients vstinner
Date 2010-05-20.12:09:23
SpamBayes Score 0.00280443
Marked as misclassified No
Message-id <1274357365.37.0.0731450159524.issue8775@psf.upfronthosting.co.za>
In-reply-to
Content
The file system is hardcoded to UTF-8 on Mac OS X, whereas the locale encoding... depends on the locale. See issue #4388 for the details.

I think that we should use the locale encoding to encode and decode command line arguments. We have to create a new encoding variable used for the command line arguments:
 * Py_CommandLineEncoding
 * sys.getcmdlineencoding()
 * (no sys.setcmdlineencoding() please!)
 * ...

This encoding only should be used on POSIX: Windows native type is unicode (wchar_t*). It should be used to decode sys.argv and to encode child processes arguments (subprocess, os.exec*(), etc.)).

On Linux, it should change anything because the file system encoding is the locale encoding. Said differently, Python3 does already use the locale encoding for the command arguments on Linux.

If you pass a filename on the command line and then open it: the filename is decoded with the locale encoding, and then encoded with the file system encoding. I fear that it will fail if both encodings are differents...
History
Date User Action Args
2010-05-20 12:09:25vstinnersetrecipients: + vstinner
2010-05-20 12:09:25vstinnersetmessageid: <1274357365.37.0.0731450159524.issue8775@psf.upfronthosting.co.za>
2010-05-20 12:09:24vstinnerlinkissue8775 messages
2010-05-20 12:09:23vstinnercreate