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-06-11.00:33:04
SpamBayes Score 0.0007866312
Marked as misclassified No
Message-id <1276216388.28.0.366593840574.issue8969@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2010-06-11 00:33:08vstinnersetrecipients: + vstinner
2010-06-11 00:33:08vstinnersetmessageid: <1276216388.28.0.366593840574.issue8969@psf.upfronthosting.co.za>
2010-06-11 00:33:06vstinnerlinkissue8969 messages
2010-06-11 00:33:06vstinnercreate