Closed
Description
BPO | 45210 |
---|---|
Nosy | @vstinner, @ezyang |
PRs | |
Files |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee = None
closed_at = None
created_at = <Date 2021-09-15.16:47:23.387>
labels = ['3.11', 'type-feature', 'docs']
title = 'tp_dealloc docs should mention error indicator may be set'
updated_at = <Date 2022-04-06.09:40:23.648>
user = 'https://github.com/ezyang'
bugs.python.org fields:
activity = <Date 2022-04-06.09:40:23.648>
actor = 'vstinner'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2021-09-15.16:47:23.387>
creator = 'ezyang'
dependencies = []
files = ['50724']
hgrepos = []
issue_num = 45210
keywords = ['patch']
message_count = 3.0
messages = ['401854', '401944', '416849']
nosy_count = 4.0
nosy_names = ['vstinner', 'docs@python', 'python-dev', 'ezyang']
pr_nums = ['28358', '32357']
priority = 'normal'
resolution = None
stage = 'patch review'
status = 'open'
superseder = None
type = 'enhancement'
url = 'https://bugs.python.org/issue45210'
versions = ['Python 3.11']
Activity
ezyang commentedon Sep 15, 2021
vstinner commentedon Sep 16, 2021
I'm not sure that it's a feature. Maybe we should modify to never call tp_dealloc with an exception set.
vstinner commentedon Apr 6, 2022
I wrote #32357 to check in debug mode that tp_dealloc functions leave the current exception unchanged. You can use attached unicode_dealloc_bug.patch to inject a bug to test my PR. Example ("make" is enough to trigger the bug):
---
Fatal Python error: _Py_Dealloc: Deallocator of type 'str' cleared the current exception
Python runtime state: initialized
Current thread 0x00007ff28d45a740 (most recent call first):
File "/home/vstinner/python/main/Lib/sysconfig.py", line 349 in _parse_makefile
File "/home/vstinner/python/main/Lib/sysconfig.py", line 470 in _generate_posix_vars
File "/home/vstinner/python/main/Lib/sysconfig.py", line 845 in _main
File "/home/vstinner/python/main/Lib/sysconfig.py", line 857 in <module>
File "<frozen runpy>", line 88 in _run_code
File "<frozen runpy>", line 198 in _run_module_as_main
generate-posix-vars failed
---
gh-89373: _Py_Dealloc() checks tp_dealloc exception (#32357)
vstinner commentedon Apr 27, 2022
I merged #32357: commit 364ed94