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

Pdb.checkline() attribute error when 'curframe' is None #72714

Closed
takluyver mannequin opened this issue Oct 25, 2016 · 6 comments
Closed

Pdb.checkline() attribute error when 'curframe' is None #72714

takluyver mannequin opened this issue Oct 25, 2016 · 6 comments
Labels
3.9 only security fixes 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error

Comments

@takluyver
Copy link
Mannequin

takluyver mannequin commented Oct 25, 2016

BPO 28528
Nosy @birkenfeld, @xdegaye, @takluyver, @miss-islington, @erlend-aasland, @iritkatriel
PRs
  • bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. #25438
  • [3.10] bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (GH-25438) #26050
  • [3.9] bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (GH-25438) #26051
  • [3.9] bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None (GH-25438) #26053
  • Files
  • pdb-reset-checkline.patch
  • 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 = <Date 2021-05-12.09:08:56.820>
    created_at = <Date 2016-10-25.13:12:03.315>
    labels = ['type-bug', 'library', '3.9', '3.10', '3.11']
    title = "Pdb.checkline() attribute error when 'curframe' is None"
    updated_at = <Date 2021-05-12.09:08:56.819>
    user = 'https://github.com/takluyver'

    bugs.python.org fields:

    activity = <Date 2021-05-12.09:08:56.819>
    actor = 'iritkatriel'
    assignee = 'none'
    closed = True
    closed_date = <Date 2021-05-12.09:08:56.820>
    closer = 'iritkatriel'
    components = ['Library (Lib)']
    creation = <Date 2016-10-25.13:12:03.315>
    creator = 'takluyver'
    dependencies = []
    files = ['45217']
    hgrepos = []
    issue_num = 28528
    keywords = ['patch']
    message_count = 6.0
    messages = ['279402', '393479', '393480', '393487', '393488', '393490']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'xdegaye', 'takluyver', 'miss-islington', 'erlendaasland', 'iritkatriel']
    pr_nums = ['25438', '26050', '26051', '26053']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = 'behavior'
    url = 'https://bugs.python.org/issue28528'
    versions = ['Python 3.9', 'Python 3.10', 'Python 3.11']

    @takluyver
    Copy link
    Mannequin Author

    takluyver mannequin commented Oct 25, 2016

    Pdb.checkline() does a hasattr() check to protect against self.curframe not existing. self.curframe can also be None (if self.forget() or self.reset() was called), but checkline() does not handle this.

    The attached patch treats self.curframe == None as equivalent to the attribute being absent.

    Background:
    http://bugs.python.org/issue9230
    ipython/ipython#10028

    (Georg, I've nosy-listed you as I saw your name on a couple of similar issues; I hope you don't mind)

    @takluyver takluyver mannequin added 3.7 (EOL) end of life stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error labels Oct 25, 2016
    @iritkatriel iritkatriel added 3.9 only security fixes 3.10 only security fixes 3.11 only security fixes and removed 3.7 (EOL) end of life labels May 11, 2021
    @iritkatriel iritkatriel changed the title Pdb.checkline() Pdb.checkline() attribute error when 'curframe' is missing May 11, 2021
    @iritkatriel iritkatriel changed the title Pdb.checkline() attribute error when 'curframe' is missing Pdb.checkline() attribute error when 'curframe' is None May 11, 2021
    @iritkatriel
    Copy link
    Member

    New changeset c90ed8e by Miss Islington (bot) in branch '3.10':
    bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None. (GH-25438) (bpo-26050)
    c90ed8e

    @iritkatriel
    Copy link
    Member

    The 3.9 backport failed because of test failures like:

    ======================================================================
    ERROR: test_checkline_is_not_executable (test.test_pdb.ChecklineTests)
    ----------------------------------------------------------------------

    Traceback (most recent call last):
      File "D:\a\cpython\cpython\lib\test\test_pdb.py", line 1752, in tearDown
        os_helper.unlink(os_helper.TESTFN)
    NameError: name 'os_helper' is not defined

    @erlend-aasland
    Copy link
    Contributor

    Yes, test.os_helper was introduced in 3.10. I've manually cherry-picked 8563a70 to 3.9 (GH-26053).

    @miss-islington
    Copy link
    Contributor

    New changeset 6c190b5 by Erlend Egeberg Aasland in branch '3.9':
    [3.9] bpo-28528: Fix pdb.checkline() attribute error when 'curframe' is None (GH-25438) (GH-26053)
    6c190b5

    @iritkatriel
    Copy link
    Member

    Thank you Erlend!

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    3.9 only security fixes 3.10 only security fixes 3.11 only security fixes stdlib Python modules in the Lib dir type-bug An unexpected behavior, bug, or error
    Projects
    None yet
    Development

    No branches or pull requests

    3 participants