Message106139
| Author |
vstinner |
| Recipients |
vstinner |
| Date |
2010年05月20日.12:09:23 |
| SpamBayes Score |
0.0028044286 |
| 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:25 | vstinner | set | recipients:
+ vstinner |
| 2010年05月20日 12:09:25 | vstinner | set | messageid: <1274357365.37.0.0731450159524.issue8775@psf.upfronthosting.co.za> |
| 2010年05月20日 12:09:24 | vstinner | link | issue8775 messages |
| 2010年05月20日 12:09:23 | vstinner | create |
|