Provide curframe_locals for backward compatibility but deprecate it#125951
Merged
gaogaotiantian merged 8 commits intopython:mainfrom Feb 8, 2025
Merged
Provide curframe_locals for backward compatibility but deprecate it#125951gaogaotiantian merged 8 commits intopython:mainfrom
gaogaotiantian merged 8 commits intopython:mainfrom
Conversation
ncoghlan
reviewed
Oct 25, 2024
Contributor
ncoghlan
left a comment
There was a problem hiding this comment.
Couple of suggestions inline for the exact deprecation warning wording, but I think we do need to mention this in NEWS and the What's New docs:
- It's a backwards compatibility fix relative to 3.13.0 and 3.14.0a1 (hence NEWS)
- It's a new deprecation warning relative to 3.12.x (hence inclusion in the What's New deprecation listings)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Member
Author
|
@ncoghlan I gave myself some vacation from CPython a few weeks ago. Now I'm picking up the unfinished stuff. I added the news to explain the deprecation. |
gabifalk
added a commit
to gabifalk/gentoo
that referenced
this pull request
Dec 17, 2024
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <gabifalk@gmx.com>
gabifalk
added a commit
to gabifalk/gentoo
that referenced
this pull request
Dec 17, 2024
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <gabifalk@gmx.com>
gentoo-bot
pushed a commit
to gentoo/gentoo
that referenced
this pull request
Dec 20, 2024
The regression was detected by ipython's own testsuite. This part of the IPython code is expected to break again with python 3.14, because the curframe_locals attribute was removed in the PR cpython#124369. However, there are plans to restore this attribute for backward compatibility in PR cpython#125951 before the CPython 3.14 release. Url: ipython/ipython#14598 Url: ipython/ipython@c1e945b Url: python/cpython#124369 Url: python/cpython#125951 Url: ipython/ipython#14620 Closes: https://bugs.gentoo.org/946568 Signed-off-by: Gabi Falk <gabifalk@gmx.com> Closes: #39746 Signed-off-by: Sam James <sam@gentoo.org>
ncoghlan
approved these changes
Jan 21, 2025
Contributor
ncoghlan
left a comment
There was a problem hiding this comment.
Suggested wording adjustment for the What's New, but otherwise LGTM!
Doc/whatsnew/3.14.rst
Outdated
Comment on lines
616
to
618
| The undocumented ``pdb.Pdb.curframe_locals`` is deprecated because with | ||
| PEP 667 we don't need to cache the locals anymore. Derived debuggers | ||
| should access ``pdb.Pdb.curframe.f_locals`` directly. |
Contributor
There was a problem hiding this comment.
Suggested change
| The undocumented ``pdb.Pdb.curframe_locals`` is deprecated because with | |
| PEP 667 we don't need to cache the locals anymore. Derived debuggers | |
| should access ``pdb.Pdb.curframe.f_locals`` directly. | |
| The undocumented ``pdb.Pdb.curframe_locals`` attribute is now a deprecated read-only property | |
| accessing ``pdb.Pdb.curframe.f_locals``. The low overhead dynamic frame locals access added in | |
| Python 3.13 by PEP 667 means the frame locals cache reference previously stored in this attribute | |
| is no longer needed. Derived debuggers should access ``pdb.Pdb.curframe.f_locals`` directly in | |
| Python 3.13 and later versions. |
Member
Author
There was a problem hiding this comment.
Is this correct? Line 617 does not read like a correct sentence.
bretello
added a commit
to bretello/pdbpp
that referenced
this pull request
Apr 18, 2025
bretello
added a commit
to bretello/pdbpp
that referenced
this pull request
Apr 18, 2025
bretello
added a commit
to bretello/pdbpp
that referenced
this pull request
Nov 17, 2025
bretello
added a commit
to bretello/pdbpp
that referenced
this pull request
Nov 17, 2025
bretello
added a commit
to bretello/pdbpp
that referenced
this pull request
Nov 23, 2025
bretello
added a commit
to bretello/pdbpp
that referenced
this pull request
Nov 24, 2025
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
We removed
pdb.Pdb.curframe_localsin #124369, but there are 3rd party libraries depending on it. We add it back but give a deprecation warning so we can really remove it in the future.