[issue8622] Add PYTHONFSENCODING environment variable
Marc-Andre Lemburg
report at bugs.python.org
Wed Aug 18 12:33:47 CEST 2010
Marc-Andre Lemburg <mal at egenix.com> added the comment:
STINNER Victor wrote:
>
> STINNER Victor <victor.stinner at haypocalc.com> added the comment:
>
> Here you have a patch. It adds tests in test_sys.
>
> The tests are skipped on a non-ascii Python executable path because of #8611 (see #9425).
Thanks for the patch.
A couple of notes:
* The command line -h explanation is missing from the patch.
* The documentation should mention that the env var is only
read once; subsequent changes to the env var are not seen
by Python
* If the codec lookup fails, Python should either issue a warning
and then ignore the env var (using the get_codeset() API).
* Unrelated to the env var, but still important: if get_codeset()
does not return a known codec, Python should issue a warning
before falling back to the default setting. Otherwise, a
Python user will never know that there's an issue and this
make debugging a lot harder.
We should also add a new sys.setfilesystemencoding()
function to make changes possible after Python startup. This
would have to go on a separate ticket, though. Or is there
some concept preventing this ?
----------
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8622>
_______________________________________
More information about the Python-bugs-list
mailing list