[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-10 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Antoine. Perhaps this non-trivial code for chaining exceptions (repeated at least three times) should be extracted to separate function. -- status: open -> closed ___ Python tracker

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-10 Thread Roundup Robot
Roundup Robot added the comment: New changeset a98fd4eeed40 by Serhiy Storchaka in branch '3.4': PyErr_NormalizeException doesn't like being called with an exception set http://hg.python.org/cpython/rev/a98fd4eeed40 New changeset 55c50c570098 by Serhiy Storchaka in branch 'default': PyErr_Normal

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: gdb backtrace: #0 0x7711ff79 in __GI_raise (sig=sig@entry=6) at ../nptl/sysdeps/unix/sysv/linux/raise.c:56 #1 0x77123388 in __GI_abort () at abort.c:89 #2 0x77118e36 in __assert_fail_base (fmt=0x7726a718 "%s%s%s:%u: %s%sAssertion

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-10 Thread Antoine Pitrou
Antoine Pitrou added the comment: This changeset crashes test_io here: test_close_error_on_close (test.test_io.CBufferedReaderTest) ... python: Objects/abstract.c:2091: PyObject_Call: Assertion `(result != ((void *)0) && !PyErr_Occurred()) || (result == ((void *)0) && PyErr_Occurred())' failed

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-09 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Thank you Martin for your report. -- resolution: -> fixed stage: patch review -> resolved status: open -> closed versions: -Python 2.7 ___ Python tracker __

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-08 Thread Roundup Robot
Roundup Robot added the comment: New changeset a3b7b89da34f by Serhiy Storchaka in branch '3.4': Issue #21677: Fixed chaining nonnormalized exceptions in io close() methods. http://hg.python.org/cpython/rev/a3b7b89da34f New changeset d6ac4b6020b9 by Serhiy Storchaka in branch 'default': Issue #2

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-07 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: Here is a patch. It fixes also the same error in TextIOWrapper. -- assignee: -> serhiy.storchaka keywords: +patch stage: -> patch review versions: +Python 2.7, Python 3.5 Added file: http://bugs.python.org/file35509/io_nonnormalized_error_on_close.p

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-06 Thread Serhiy Storchaka
Changes by Serhiy Storchaka : -- nosy: +benjamin.peterson, pitrou, serhiy.storchaka, stutzbach ___ Python tracker ___ ___ Python-bugs-

[issue21677] Exception context set to string by BufferedWriter.close()

2014-06-05 Thread Martin Panter
New submission from Martin Panter: I made a writer class whose write() and flush() methods (unintentionally) triggered exceptions. I wrapped this in a BufferedWriter. When close() is called, the resulting exception has a string object in its __context__ attribute. Although the original error w