Message106013
Attached patch creates PySys_AddWarnOptionUnicode() function and decodes PYTHONWARNINGS variable with the file system encoding (as it is done for os.environ, to be consistent) instead of the locale encoding.
The patch only concerns the POSIX version. Windows is not affected by this issue (see below).
--
This issue occurs if the file system encoding is different than the locale encoding (especially if the locale encoding is ASCII). It only occurs on Mac OS because on this OS, the file system encoding is hardcoded to UTF-8 whereas the locale encoding... depends on the locale.
I reproduced the bug on Linux by hardcoding the file system encoding to UTF-8.
--
About the test output (UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' ...): I think that Michael Foord executed directly Lib/test/test_warnings.py instead of using "Lib/test/regrtest.py -v test_warnings". I only patched regrtest.py to use backslashreplace error handler on sys.stdout. |
|
Date |
User |
Action |
Args |
2010-05-18 23:27:05 | vstinner | set | recipients:
+ vstinner, brett.cannon, r.david.murray, michael.foord |
2010-05-18 23:27:05 | vstinner | set | messageid: <1274225225.11.0.473683675376.issue8589@psf.upfronthosting.co.za> |
2010-05-18 23:27:01 | vstinner | link | issue8589 messages |
2010-05-18 23:27:00 | vstinner | create | |
|