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.

Title: open() doesn't use locale.getpreferredencoding()
Type: behavior Stage:
Components: IO Versions: Python 3.7, Python 3.6
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: benjamin.peterson, brett.cannon, eric.snow, ncoghlan, serhiy.storchaka, stutzbach, vstinner
Priority: normal Keywords:

Created on 2017-09-23 21:49 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin.

Messages (1)
msg302812 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-09-23 21:49
It is documented that the default encoding for open() and io.TextIOWrapper() is locale.getpreferredencoding(). But actually the C implementation in Python 3 uses _bootlocale.getpreferredencoding(). Monkey-patching locale.getpreferredencoding doesn't affect open().
Date User Action Args
2022-04-11 14:58:52adminsetgithub: 75746
2017-09-23 22:54:56vstinnersetnosy: + vstinner
2017-09-23 21:49:37serhiy.storchakacreate