[issue20520] Readline test in test_codecs is broken
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: needs patch - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Serhiy Storchaka added the comment: Aha! It looks as a bug in UTF-7 codec. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Vajrasky Kok added the comment: The culprit: diff -r b4e99bec0c8a Lib/test/test_codecs.py --- a/Lib/test/test_codecs.py Fri Feb 07 10:10:55 2014 +0200 +++ b/Lib/test/test_codecs.py Fri Feb 07 17:14:12 2014 +0800 @@ -164,6 +164,8 @@ s = 10*(size*a + lineend + xxx\n) reader = getreader(s) for i in range(10): +if size==64 and self.encoding == 'utf-7' and lineend=='\u2028' and i == 3: +import pdb; pdb.set_trace() self.assertEqual( reader.readline(keepends=True), size*a + lineend, -- nosy: +vajrasky ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Serhiy Storchaka added the comment: Opened separate issue20538 for this bug. -- dependencies: +Segfault in UTF-7 incremental decoder ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Serhiy Storchaka added the comment: Thank you Vajrasky. I got the same result. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Ned Deily added the comment: The change has broken the builds, for example, http://buildbot.python.org/all/builders/AMD64%20Snow%20Leop%203.x/builds/1197. [ 29/389] test_codecs Assertion failed: (maxchar = 0x100), function _PyUnicode_CheckConsistency, file Objects/unicodeobject.c, line 410. Fatal Python error: Aborted Current thread 0x7fff71296cc0 (most recent call first): File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/codecs.py, line 494 in read File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/codecs.py, line 548 in readline File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/test_codecs.py, line 169 in test_readline File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, line 574 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/case.py, line 622 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 125 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 87 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 125 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 87 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 125 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/suite.py, line 87 in __call__ File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/unittest/runner.py, line 168 in run File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py, line 1685 in _run_suite File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/support/__init__.py, line 1719 in run_unittest File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1277 in lambda File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1278 in runtest_inner File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 967 in runtest File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 532 in main File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1565 in main_in_temp_cwd File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1590 in module File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, line 86 in _run_code File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, line 171 in _run_module_as_main Traceback (most recent call last): File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, line 171, in _run_module_as_main __main__, mod_spec) File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/runpy.py, line 86, in _run_code exec(code, run_globals) File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/__main__.py, line 3, in module regrtest.main_in_temp_cwd() File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 1565, in main_in_temp_cwd main() File /Users/buildbot/buildarea/3.x.murray-snowleopard/build/Lib/test/regrtest.py, line 738, in main raise Exception(Child error on {}: {}.format(test, result[1])) Exception: Child error on test_codecs: Exit code -6 make: *** [buildbottest] Error 1 -- assignee: - serhiy.storchaka nosy: +benjamin.peterson, georg.brandl, larry, ned.deily priority: normal - release blocker resolution: fixed - stage: committed/rejected - needs patch status: closed - open ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
New submission from Serhiy Storchaka: The ReadTest.test_readline test in Lib/test/test_codecs.py has two loops on \n \r\n \r \u2028.split(). But as far as \n \r\n \r \u2028.split() is empty list (because newline characters are whitespace characters), the bodies of these loops are never executed. After fixing this bug, a number of other tests were exposed. I tried to fix them. The purpose of these tests is not entirely clear, so I'm not sure that it is properly grasped the idea of the author. Test was added in issue1076985 and modified in issue1175396. -- components: Tests files: test_codecs_readline.patch keywords: patch messages: 210309 nosy: doerwalter, serhiy.storchaka priority: normal severity: normal stage: patch review status: open title: Readline test in test_codecs is broken type: behavior versions: Python 2.7, Python 3.3, Python 3.4 Added file: http://bugs.python.org/file33928/test_codecs_readline.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Walter Dörwald added the comment: \n \r\n \r \u2028.split() should have been \n \r\n \r \u2028.split( ), i.e. a list of different line ends. The purpose of these tests is not entirely clear, so I'm not sure that it is properly grasped the idea of the author. I wrote the tests nearly 10 years ago, so it's no longer entirely clear to me either! ;) Anyway, here's a patch that fixes the resulting test failures. -- Added file: http://bugs.python.org/file33930/fix_linetests.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Serhiy Storchaka added the comment: \n \r\n \r \u2028.split() should have been \n \r\n \r \u2028.split( ), i.e. a list of different line ends. Yes, this is obvious fix, but explicit tuple of line ends looks more clear and error-proof to me. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Walter Dörwald added the comment: True, here's an updated patch. -- Added file: http://bugs.python.org/file33933/fix_linetests2.diff ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Roundup Robot added the comment: New changeset 305b6a5da852 by Serhiy Storchaka in branch '2.7': Issue #20520: Fixed readline test in test_codecs. http://hg.python.org/cpython/rev/305b6a5da852 New changeset 82d374a9bbc7 by Serhiy Storchaka in branch '3.3': Issue #20520: Fixed readline test in test_codecs. http://hg.python.org/cpython/rev/82d374a9bbc7 New changeset 1457fa0da200 by Serhiy Storchaka in branch 'default': Issue #20520: Fixed readline test in test_codecs. http://hg.python.org/cpython/rev/1457fa0da200 -- nosy: +python-dev ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com
[issue20520] Readline test in test_codecs is broken
Changes by Serhiy Storchaka storch...@gmail.com: -- resolution: - fixed stage: patch review - committed/rejected status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue20520 ___ ___ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com