消息 [107510]
mbcs encoding doesn't support surrogateescape (see #850997), and mbcs should only be used in strict mode to encode/decode filenames.
os.fsencode() should also be enabled on Windows. First I tried to disable this function on Windows to avoid the evil mbcs encoding, but mbcs encoding *is* used by some modules written in C (functions using PyUnicode_FSConverter(): encode the filename to bytes with mbcs encoding on Windows). Eg. _ssl module use PyUnicode_FSConverter() to get filenames because the underlying library, OpenSSL, requires bytes for the filenames (C type: char*). Enable os.fsencode() on Windows helps some tests (eg. fix test_ssl).
Use "strict" error handler, instead of "surrogateescape", to encode/decode filenames with mbcs encoding, does nothing yet because mbcs codec ignore the errors argument. These changes prepare the work on mbcs codec: see #850997.
Note: os.fsencode() was introduced by #8514. |
|
| 日期 |
用户 |
动作 |
参数 |
| 2010-06-11 00:33:08 | vstinner | 修改 | recipients:
+ vstinner |
| 2010-06-11 00:33:08 | vstinner | 修改 | messageid: <1276216388.28.0.366593840574.issue8969@psf.upfronthosting.co.za> |
| 2010-06-11 00:33:06 | vstinner | 链接 | issue8969 messages |
| 2010-06-11 00:33:06 | vstinner | 创建 | |
|