Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

co_lnotab must be removed in 3.12 according to PEP 626 #101865

Closed
sobolevn opened this issue Feb 13, 2023 · 2 comments
Closed

co_lnotab must be removed in 3.12 according to PEP 626 #101865

sobolevn opened this issue Feb 13, 2023 · 2 comments
Assignees
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement

Comments

@sobolevn
Copy link
Member

sobolevn commented Feb 13, 2023

The co_lnotab attribute will be deprecated in 3.10 and removed in 3.12.

https://peps.python.org/pep-0626/#backwards-compatibility

It was documented as deprecated in 3.10 and to-be-removed in 3.12: https://docs.python.org/3/whatsnew/3.10.html#pep-626-precise-line-numbers-for-debugging-and-other-tools

Original issue: #86412

Right now CPython does not use co_lnotab in its source code.
But, there are two mentions of it:

  1. In gdb:

    cpython/Misc/gdbinit

    Lines 60 to 61 in 6ef6915

    set $__sz = ((PyVarObject *)$__co->co_lnotab)->ob_size/2
    set $__p = (unsigned char *)((PyBytesObject *)$__co->co_lnotab)->ob_sval
    And I have no idea how it works! Some weird mix of C and some kind of a DSL / scripting language
  2. In clinic.test:
    co_lnotab: PyBytesObject(c_default="(PyBytesObject *)self->co_lnotab") = None
    But, this is just a string-based test. So, I think it can stay there

If that's fine - I would like to do the honours.

CC @markshannon

Linked PRs

@sobolevn sobolevn added type-feature A feature request or enhancement interpreter-core (Objects, Python, Grammar, and Parser dirs) 3.12 bugs and security fixes labels Feb 13, 2023
@sobolevn sobolevn self-assigned this Feb 13, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Feb 13, 2023
@markshannon
Copy link
Member

I don't get any warning when using co_lnotab in 3.11, so I don't think we can remove it yet.
Don't assume everyone has read PEP 626.

We should at least warn when using it for a couple of versions, before removing it.

It isn't causing us any problems either, so there is not rush to remove it. It can wait for 3.14 or so.

@sobolevn
Copy link
Member Author

Ok then, so DeprecationWarning it is! 👍

sobolevn added a commit to sobolevn/cpython that referenced this issue Feb 21, 2023
sobolevn added a commit to sobolevn/cpython that referenced this issue Feb 21, 2023
@hugovk hugovk changed the title co_lnotab must be removed in 3.12 according to PEP626 co_lnotab must be removed in 3.12 according to PEP 626 Mar 18, 2023
ambv pushed a commit that referenced this issue Apr 3, 2023
gaogaotiantian pushed a commit to gaogaotiantian/cpython that referenced this issue Apr 8, 2023
warsaw pushed a commit to warsaw/cpython that referenced this issue Apr 11, 2023
hugovk added a commit to hugovk/cpython that referenced this issue Nov 4, 2024
… 3.14 (pythonGH-126392)

(cherry picked from commit eac41c5)

Co-authored-by: Hugo van Kemenade <[email protected]>
hugovk added a commit to hugovk/cpython that referenced this issue Nov 4, 2024
… 3.14 (pythonGH-126392)

(cherry picked from commit eac41c5)

Co-authored-by: Hugo van Kemenade <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
3.12 bugs and security fixes interpreter-core (Objects, Python, Grammar, and Parser dirs) type-feature A feature request or enhancement
Projects
None yet
Development

No branches or pull requests

3 participants