This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: _PyGen_Finalize() should not fail with an exception
Type: Stage: resolved
Components: Versions: Python 3.6
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: arigo, benjamin.peterson, python-dev
Priority: normal Keywords: needs review, patch

Created on 2016-08-20 09:35 by arigo, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch1.diff arigo, 2016-08-20 09:35 review
Messages (4)
msg273199 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2016-08-20 09:35
_PyGen_Finalize() should not fail with an exception.  Doing so can cause various SystemErrors or even fatal errors.  For example, run this with "python -Werror":

    import gc
    async def f():
        pass
    f()
    gc.collect()   # RuntimeWarning, but with -Werror

Patch attached.  Test missing (turn the above example in a test; also I didn't re-run all tests with this patch).
msg274407 - (view) Author: Benjamin Peterson (benjamin.peterson) * (Python committer) Date: 2016-09-05 17:16
Thank you, Armin.
msg274408 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2016-09-05 17:17
New changeset 4d531711cbc7 by Benjamin Peterson in branch '3.5':
do not allow _PyGen_Finalize to fail (closes #27811)
https://hg.python.org/cpython/rev/4d531711cbc7

New changeset 1b14dbe9e98b by Benjamin Peterson in branch 'default':
merge 3.5 (closes #27811)
https://hg.python.org/cpython/rev/1b14dbe9e98b
msg274428 - (view) Author: Armin Rigo (arigo) * (Python committer) Date: 2016-09-05 20:22
You're welcome.  Unrelated, but I'm collecting similar issues in a file at http://bitbucket.org/pypy/extradoc/raw/extradoc/planning/py3.5/cpython-crashers.rst .  After reporting the first two, I stopped, and will report them all in bulk some time later, but you may be interested in fixing a couple more for the upcoming 3.6 release.
History
Date User Action Args
2022-04-11 14:58:35adminsetgithub: 71998
2016-09-05 20:22:58arigosetmessages: + msg274428
2016-09-05 17:17:51python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg274408

resolution: fixed
stage: resolved
2016-09-05 17:16:43benjamin.petersonsetnosy: + benjamin.peterson
messages: + msg274407
2016-08-20 09:35:05arigocreate