JGoutin added the comment:
import sys
# Force the use of legacy encoding like versions of Python prior to 3.6.
sys._enablelegacywindowsfsencoding()
# Show actual file system encoding
encoding = sys.getfilesystemencoding()
print('File system encoding:', encoding)
# os.fsencode(filename) VS filename.encode(File system encoding)
import os
print(os.fsencode('é'), 'é'.encode(encoding))
>>> File system encoding: mbcs
>>> b'\xc3\xa9' b'\xe9'
The result is the same.
----------
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue29241>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com