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 ZackerySpytz, eryksun, paul.moore, steve.dower, tim.golden, vstinner, zach.ware
Date 2020-02-07.08:12:22
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1581063142.91.0.782326965925.issue37413@roundup.psfhosted.org>
In-reply-to
Content
One of sys._enablelegacywindowsfsencoding() issue is that os.fsdecode() and os.fsencode() are not updated, they continue to use UTF-8. Example on Windows:

>>> import sys, os
>>> sys.getfilesystemencoding()
'utf-8'
>>> os.fsencode('\xe9')
b'\xc3\xa9'
>>> sys._enablelegacywindowsfsencoding()
>>> sys.getfilesystemencoding()
'mbcs'
>>> os.fsencode('\xe9')
b'\xc3\xa9'

See bpo-29241 for larger issues caused by this function.

--

The first reason is deprecate this function is that it sounds dangerous to me and it doesn't seem to be used.

I only found one project which used it temporarily until they fixed their code to encode/decode filenames on Windows. It was used to workaround a in bug in their code.
History
Date User Action Args
2020-02-07 08:12:22vstinnersetrecipients: + vstinner, paul.moore, tim.golden, zach.ware, eryksun, steve.dower, ZackerySpytz
2020-02-07 08:12:22vstinnersetmessageid: <1581063142.91.0.782326965925.issue37413@roundup.psfhosted.org>
2020-02-07 08:12:22vstinnerlinkissue37413 messages
2020-02-07 08:12:22vstinnercreate