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(skip=[...]) + module without __name__ => TypeError #80311

Closed
asottile mannequin opened this issue Feb 27, 2019 · 3 comments
Closed

Pdb(skip=[...]) + module without __name__ => TypeError #80311

asottile mannequin opened this issue Feb 27, 2019 · 3 comments
Labels
3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir

Comments

@asottile
Copy link
Mannequin

asottile mannequin commented Feb 27, 2019

BPO 36130
Nosy @blueyed, @xdegaye, @asottile, @tirkarthi
PRs
  • bpo-36130: Fix stepping into a frame without a __name__ #12064
  • 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 2019-11-15.04:58:09.876>
    created_at = <Date 2019-02-27.03:46:52.169>
    labels = ['3.8', '3.7', 'library']
    title = 'Pdb(skip=[...]) + module without __name__ => TypeError'
    updated_at = <Date 2019-11-15.05:02:18.434>
    user = 'https://github.com/asottile'

    bugs.python.org fields:

    activity = <Date 2019-11-15.05:02:18.434>
    actor = 'xtreak'
    assignee = 'none'
    closed = True
    closed_date = <Date 2019-11-15.04:58:09.876>
    closer = 'benjamin.peterson'
    components = ['Library (Lib)']
    creation = <Date 2019-02-27.03:46:52.169>
    creator = 'Anthony Sottile'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 36130
    keywords = ['patch']
    message_count = 3.0
    messages = ['336728', '356644', '356645']
    nosy_count = 4.0
    nosy_names = ['blueyed', 'xdegaye', 'Anthony Sottile', 'xtreak']
    pr_nums = ['12064']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue36130'
    versions = ['Python 3.7', 'Python 3.8']

    @asottile
    Copy link
    Mannequin Author

    asottile mannequin commented Feb 27, 2019

    Here's the simplest example I could come up with -- hit this while debugging pytest (which uses attrs which uses similar code to this to make classes)

    import pdb; pdb.Pdb(skip=['django.*']).set_trace()
    eval(compile("1", "", "exec"), {})
    print('ok!')

    When running this:

    $ python3.8 t.py
    > /home/asottile/workspace/setup-cfg-fmt/t.py(2)<module>()
    -> eval(compile("1", "", "exec"), {})
    (Pdb) n
    Traceback (most recent call last):
      File "t.py", line 2, in <module>
        eval(compile("1", "", "exec"), {})
      File "", line 1, in <module>
      File "/usr/lib/python3.8/bdb.py", line 90, in trace_dispatch
        return self.dispatch_call(frame, arg)
      File "/usr/lib/python3.8/bdb.py", line 128, in dispatch_call
        if not (self.stop_here(frame) or self.break_anywhere(frame)):
      File "/usr/lib/python3.8/bdb.py", line 203, in stop_here
        self.is_skipped_module(frame.f_globals.get('__name__')):
      File "/usr/lib/python3.8/bdb.py", line 194, in is_skipped_module
        if fnmatch.fnmatch(module_name, pattern):
      File "/usr/lib/python3.8/fnmatch.py", line 34, in fnmatch
        name = os.path.normcase(name)
      File "/usr/lib/python3.8/posixpath.py", line 54, in normcase
        s = os.fspath(s)
    TypeError: expected str, bytes or os.PathLike object, not NoneType
    $ python3.8 --version --version
    Python 3.8.0a2 (default, Feb 25 2019, 23:11:49) 
    [GCC 7.3.0]

    @asottile asottile mannequin added 3.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir labels Feb 27, 2019
    @blueyed
    Copy link
    Mannequin

    blueyed mannequin commented Nov 15, 2019

    This was fixed / can be closed (#12064).

    @tirkarthi
    Copy link
    Member

    Thanks @blueyed, I guess the backport was not made by the bot though the label was applied for 3.7 branch.

    @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.7 (EOL) end of life 3.8 only security fixes stdlib Python modules in the Lib dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants