classification
Title: open() doesn't use locale.getpreferredencoding()
Type: behavior Stage:
Components: IO Versions: Python 3.7, Python 3.6
process
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 2017-09-23 22:54 by vstinner.

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().
History
Date User Action Args
2017-09-23 22:54:56vstinnersetnosy: + vstinner
2017-09-23 21:49:37serhiy.storchakacreate