[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: I don't see any test_warnings anymore on http://code.google.com/p/bbreport/wiki/PythonBuildbotReport. Close this issue. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: Still happens with r84709 on PPC Tiger 3.x It's not the same error, PYTHONWARNINGS is decoded from the wrong encoding: locale encodind instead of utf-8. r84731 should fix this bug (at least, it restores the encoding used because my last commit, r84694). With r84731, Python decodes PYTHONWARNINGS with strict error handler on Mac OS X, instead of surrogateescape error handler. I don't think that it matters because PYTHONWARNINGS is not supposed to contain raw bytes, and anyway, Mac OS X rejects invalid utf-8 filenames. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Florent Xicluna florent.xicl...@gmail.com added the comment: Still happens with r84709 on PPC Tiger 3.x == FAIL: test_nonascii (test.test_warnings.CEnvironmentVariableTests) -- Traceback (most recent call last): File /Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/test/test_warnings.py, line 731, in test_nonascii ['ignore:Deprecaci\xf3nWarning'].encode('utf-8')) AssertionError: b['ignore:Deprecaci\xc3\x83\xc2\xb3nWarning'] != b['ignore:Deprecaci\xc3\xb3nWarning'] == FAIL: test_nonascii (test.test_warnings.PyEnvironmentVariableTests) -- Traceback (most recent call last): File /Users/buildbot/buildarea/3.x.parc-tiger-1/build/Lib/test/test_warnings.py, line 731, in test_nonascii ['ignore:Deprecaci\xf3nWarning'].encode('utf-8')) AssertionError: b['ignore:Deprecaci\xc3\x83\xc2\xb3nWarning'] != b['ignore:Deprecaci\xc3\xb3nWarning'] -- Ran 71 tests in 9.113s FAILED (failures=2) http://www.python.org/dev/buildbot/builders/PPC%20Tiger%203.x/builds/566 -- status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: It should be fixed by r84694. -- status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Florent Xicluna florent.xicl...@gmail.com added the comment: A similar issue occurs on x86 debian parallel buildbot: == FAIL: test_nonascii (test.test_warnings.CEnvironmentVariableTests) -- Traceback (most recent call last): File /home2/buildbot2/slave/3.x.loewis-parallel/build/Lib/test/test_warnings.py, line 731, in test_nonascii ['ignore:DeprecaciónWarning'].encode('utf-8')) AssertionError: b'' != b['ignore:Deprecaci\xc3\xb3nWarning'] http://www.python.org/dev/buildbot/builders/x86%20debian%20parallel%203.x/builds/80 -- nosy: +flox status: closed - open type: - behavior ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Florent Xicluna florent.xicl...@gmail.com added the comment: There's a failure on the same buildbot, x86 debian parallel, with test test_subprocess (test_undecodable_env). This test was introduced with issue #8391. The test_subprocess and test_warnings failures are specific to this buildbot. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Changes by Florent Xicluna florent.xicl...@gmail.com: -- keywords: +buildbot ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: I know test_warnings failure and I will try to fix it soon. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: tarek tested on Mac OS X: the patch fixes test_warnings issue. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: Ok, I commited my patch: r81358 (py3k). I'm waiting for the buildbots before backporting the fix to 3.1. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Changes by STINNER Victor victor.stin...@haypocalc.com: -- resolution: - fixed status: open - pending ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: Oh, Python 3.1 doesn't use the PYTHONWARNINGS variable: commit blocked in 3.1 (r81362). -- dependencies: -regrtest: use backslashreplace error handler for stdout status: pending - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: The test was introduced by r80066 (issue #7301). -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: os.environ is decoded with sys.getfilesystemencoding(), whereas PYTHONWARNINGS is decoded with the locale encoding (locale.getpreferredencoding()) :-/ -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: 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. -- keywords: +patch Added file: http://bugs.python.org/file17389/sys_warnoptions_encoding.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: Does my fix this #8533 fixes this issue or not? I guess yes, but I would prefer a confirmation. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
STINNER Victor victor.stin...@haypocalc.com added the comment: The bug only occurs on Mac OS X because file system encoding is hardcoded to UTF-8 on this OS and the test is skipped if the file system encoding is ASCII. But the bug is not specific to test_warnings, as mentionned by R. David Murray: #8533 is the real bug. test_warnings is just an example to reproduce it. I just commited a fix for #8533: it should fix also this issue. -- assignee: brett.cannon - haypo dependencies: +regrtest: use backslashreplace error handler for stdout ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
New submission from Michael Foord mich...@voidspace.org.uk: If you run test_warnings.py under an ascii terminal (at least on Mac OS X) then test_warnings.CEnvironmentVariableTests.test_nonascii fails. Perhaps the test should be skipped? == FAIL: test_nonascii (__main__.CEnvironmentVariableTests) -- Traceback (most recent call last): File Lib/test/test_warnings.py, line 758, in module test_main() File Lib/test/test_warnings.py, line 753, in test_main PyEnvironmentVariableTests File /compile/python-trunk3/Lib/test/support.py, line 1053, in run_unittest _run_suite(suite) File /compile/python-trunk3/Lib/test/support.py, line 1027, in _run_suite result = runner.run(suite) File /compile/python-trunk3/Lib/unittest/runner.py, line 158, in run result.printErrors() File /compile/python-trunk3/Lib/unittest/runner.py, line 109, in printErrors self.printErrorList('FAIL', self.failures) File /compile/python-trunk3/Lib/unittest/runner.py, line 116, in printErrorList self.stream.writeln(%s % err) File /compile/python-trunk3/Lib/unittest/runner.py, line 24, in writeln self.write(arg) UnicodeEncodeError: 'ascii' codec can't encode character '\xf3' in position 121: ordinal not in range(128) Looks like the traceback here actually comes from unittest trying to report the failure. -- messages: 104709 nosy: michael.foord priority: normal severity: normal status: open title: test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal versions: Python 3.2 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Changes by Antoine Pitrou pit...@free.fr: -- assignee: - brett.cannon components: +Tests nosy: +brett.cannon, haypo ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
R. David Murray rdmur...@bitdance.com added the comment: Victor has proposed a patch for the traceback problem for regrtest, I think. I haven't looked at it, but I wonder if there is something that can instead be done to make unittest work in cases like this when run in an ascii terminal. See issue 8522. -- nosy: +r.david.murray ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue8589] test_warnings.CEnvironmentVariableTests.test_nonascii fails under an ascii terminal
Michael Foord mich...@voidspace.org.uk added the comment: What does issue 8522 have to do with it - did you mean a different issue? In unittest it could catch the UnicodeEncodeError and write the ascii repr instead. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue8589 ___ ___ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com