[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-03-18 Thread STINNER Victor
STINNER Victor added the comment: @Antoine: exctests.patch looks good to me, can you commit it? -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-03-18 Thread Antoine Pitrou
Changes by Antoine Pitrou pit...@free.fr: -- resolution: - fixed stage: - resolved status: open - closed ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-03-18 Thread STINNER Victor
STINNER Victor added the comment: Thanks Antoine! -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___ ___ Python-bugs-list mailing list

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-03-18 Thread Roundup Robot
Roundup Robot added the comment: New changeset ac43268da908 by Antoine Pitrou in branch '3.4': Issue #23353: improve exceptions tests for generators https://hg.python.org/cpython/rev/ac43268da908 New changeset b29342f53174 by Antoine Pitrou in branch 'default': Issue #23353: improve exceptions

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-02-07 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-02-02 Thread Roundup Robot
Roundup Robot added the comment: New changeset 2cd6621a9fbc by Victor Stinner in branch '3.4': Issue #23353, asyncio: Workaround CPython bug #23353 https://hg.python.org/cpython/rev/2cd6621a9fbc -- ___ Python tracker rep...@bugs.python.org

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: Additional simple tests for test_exceptions.py. -- Added file: http://bugs.python.org/file37943/exctests.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: If you need non-normalized exception for testing, a NameError generated by interpreter is not normalized. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: It would have been nice to wait for a review. Generator tests are already in test_exceptions.py. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread STINNER Victor
STINNER Victor added the comment: It would have been nice to wait for a review. Generator tests are already in test_exceptions.py. Sorry, I wanted to quickly push your fix to fix buildbots. I dislike being the responsible of turning all buildbots to red... Before working on this issue, I

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread STINNER Victor
STINNER Victor added the comment: By the way: buildbots are green again, cool. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___ ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread STINNER Victor
STINNER Victor added the comment: I agree that it's better to not change the behaviour of generators, backward compatibility matters :-) I wrote tests using my examples and I combined them with gen_exc_state_restore.patch. I commited the changeset in Python 3.4 and 3.5. Backporting the fix

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread Roundup Robot
Roundup Robot added the comment: New changeset 4555da8c3091 by Victor Stinner in branch '3.4': Issue #23353: Fix the exception handling of generators in PyEval_EvalFrameEx(). https://hg.python.org/cpython/rev/4555da8c3091 -- nosy: +python-dev ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-31 Thread Antoine Pitrou
Antoine Pitrou added the comment: I think your patch for 2.7 is wrong as was your patch for 3.x. You shouldn't change the behaviour of sys.exc_info() in the nominal case. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Last major change related to generators in Python/ceval.c: --- changeset: 47594:212a1fee6bf9 parent: 47585:b0ef00187a7e user:Benjamin Peterson benja...@python.org date:Wed Jun 11 15:59:43 2008 + files: Doc/library/dis.rst

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
Changes by STINNER Victor victor.stin...@gmail.com: -- nosy: +pitrou, serhiy.storchaka ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___ ___

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Attached gen_exc_value_py27.patch: Patch for Python 2.7. No unit test yet. The full test suite of trollius pass on the patched Python 2.7 and on the patched Python 3.5. The full test suite of asyncio also pass on the patched Python 3.5. -- Added

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Attached gen_exc_value.patch changes how generators handle the currently handled exception (tstate-exc_value). The patch probably lacks tests to test the exact behaviour of sys.exc_info(). The 3 examples below can be used to write such tests. But before

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Oh, by the way: keeping the exception after the except block is also a tricky reference leak. In Python 3, since exceptions store their traceback, this issue may keep a lot of objects alive too long, whereas they are expected to be destroyed much earlier.

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: See also: * PEP 3134: Exception Chaining and Embedded Tracebacks (Python 3.0) * Issue #3021: Lexical exception handlers (Python 3.0) -- thread: https://mail.python.org/pipermail/python-3000/2008-May/013740.html * PEP 380: Syntax for Delegating to a

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Currently, a generator inherits the currently handled exception from the caller This is expected, since this is how normal functions behave. -- ___ Python tracker rep...@bugs.python.org

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread STINNER Victor
STINNER Victor added the comment: Currently, a generator inherits the currently handled exception from the caller This is expected, since this is how normal functions behave. Do you see how to fix the issue without changing the behaviour? --

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Attached patch fixes the test script and doesn't break any test. -- Added file: http://bugs.python.org/file37933/gen_exc_state_restore.patch ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353

[issue23353] generator bug with exception: tstate-exc_value is not cleared after an except block

2015-01-30 Thread Antoine Pitrou
Antoine Pitrou added the comment: Note the patch also fixes the reference leak in test_asyncio. -- ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue23353 ___