Skip to content

Document types.CodeType.replace() changes about co_exceptiontable #91392

Closed

Description

@vstinner
BPO 47236
Nosy @gvanrossum, @vstinner

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 2022-04-05.23:22:06.882>
labels = ['3.11', 'docs']
title = 'Document types.CodeType.replace() changes about co_exceptiontable'
updated_at = <Date 2022-04-05.23:23:47.642>
user = 'https://github.com/vstinner'

bugs.python.org fields:

activity = <Date 2022-04-05.23:23:47.642>
actor = 'gvanrossum'
assignee = 'docs@python'
closed = False
closed_date = None
closer = None
components = ['Documentation']
creation = <Date 2022-04-05.23:22:06.882>
creator = 'vstinner'
dependencies = []
files = []
hgrepos = []
issue_num = 47236
keywords = []
message_count = 1.0
messages = ['416831']
nosy_count = 3.0
nosy_names = ['gvanrossum', 'vstinner', 'docs@python']
pr_nums = []
priority = 'normal'
resolution = None
stage = None
status = 'open'
superseder = None
type = None
url = 'https://bugs.python.org/issue47236'
versions = ['Python 3.11']

Activity

  1. vstinner commented on Apr 5, 2022

    @vstinner
    MemberAuthor

    It would be nice to document the bpo-40222 changes in What's New in Python 3.11 and in the CodeType documentation:

    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.txt

    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.

  2. added
    docsDocumentation in the Doc dir
    3.11only security fixes
    on Apr 5, 2022
  3. transferred this issue fromon Apr 10, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    3.11only security fixesdocsDocumentation in the Doc dir

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions