[issue47236] Document types.CodeType.replace() changes about co_exceptiontable
New submission from STINNER Victor <vstinner@python.org>: It would be nice to document the bpo-40222 changes in What's New in Python 3.11 and in the CodeType documentation: * https://docs.python.org/dev/library/types.html#types.CodeType * https://docs.python.org/dev/whatsnew/3.11.html Users of types.CodeType.replace(co_code=new_code) must now pass co_exceptiontable or exception handling will no longer work as expected. Callers are responsible to build co_exceptiontable. Currently, the format of this table is documented at: https://github.com/python/cpython/blob/main/Objects/exception_handling_notes... There is no public function to encode this table, it's also the responsibility of the caller. See also bpo-47185 "code.replace(co_code=new_code) no longer catch exceptions on Python 3.11" closed as "won't fix" for the background. ---------- assignee: docs@python components: Documentation messages: 416831 nosy: docs@python, vstinner priority: normal severity: normal status: open title: Document types.CodeType.replace() changes about co_exceptiontable versions: Python 3.11 _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue47236> _______________________________________
Change by Guido van Rossum <guido@python.org>: ---------- nosy: +gvanrossum _______________________________________ Python tracker <report@bugs.python.org> <https://bugs.python.org/issue47236> _______________________________________
participants (2)
-
Guido van Rossum
-
STINNER Victor