Message325096
I modified Py_Main() to ignore the PYTHONCOERCECLOCALE environment variable if -E or -I command line option is used. But Nick asks to always read PYTHONCOERCECLOCALE.
We should either update the PEP or change the code.
I am not sure why PYTHONCOERCECLOCALE should be handled differently than other PYTHON* variable like PYTHONWARNINGS or PYTHONUTF8. Is it because it impacts the encodings? Is it because there was a chicken-and-egg issue before I reworked Py_Main() code? (PYTHONCOERCECLOCALE env var was read before reading command line arguments.)
--
Copy of Nick Coghlan's msg325009:
(The one exception to "nothing gets decoded incorrectly" is that PYTHONCOERCECLOCALE itself is always interpreted as an ASCII field: the values that it checks for are actually ASCII byte sequences, not Unicode code points.
The documentation could definitely be much clearer on that point though, as even in the PEP it's only implied by the final paragraph in https://www.python.org/dev/peps/pep-0538/#legacy-c-locale-coercion-in-the-standalone-python-interpreter-binary which is mostly talking about the fact that this particular environment variable is still checked, even if you pass the -I or -E command line options. |
|
Date |
User |
Action |
Args |
2018-09-11 23:47:42 | vstinner | set | recipients:
+ vstinner |
2018-09-11 23:47:42 | vstinner | set | messageid: <1536709662.94.0.0269046726804.issue34639@psf.upfronthosting.co.za> |
2018-09-11 23:47:42 | vstinner | link | issue34639 messages |
2018-09-11 23:47:42 | vstinner | create | |
|