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.

作者 vstinner
收信人 vstinner
日期 2010-06-11.00:33:04
SpamBayes Score 0.0007866312
Marked as misclassified
Message-id <1276216388.28.0.366593840574.issue8969@psf.upfronthosting.co.za>
In-reply-to
内容
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:08vstinner修改recipients: + vstinner
2010-06-11 00:33:08vstinner修改messageid: <1276216388.28.0.366593840574.issue8969@psf.upfronthosting.co.za>
2010-06-11 00:33:06vstinner链接issue8969 messages
2010-06-11 00:33:06vstinner创建