This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Pdb(skip=[...]) + module without __name__ => TypeError
Type: Stage: resolved
Components: Library (Lib) Versions: Python 3.8, Python 3.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Anthony Sottile, blueyed, xdegaye, xtreak
Priority: normal Keywords: patch

Created on 2019-02-27 03:46 by Anthony Sottile, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 12064 merged Anthony Sottile, 2019-02-27 06:43
Messages (3)
msg336728 - (view) Author: Anthony Sottile (Anthony Sottile) * Date: 2019-02-27 03:46
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]
msg356644 - (view) Author: daniel hahler (blueyed) * Date: 2019-11-15 03:38
This was fixed / can be closed (https://github.com/python/cpython/pull/12064).
msg356645 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-11-15 05:02
Thanks @blueyed, I guess the backport was not made by the bot though the label was applied for 3.7 branch.
History
Date User Action Args
2022-04-11 14:59:11adminsetgithub: 80311
2019-11-15 05:02:18xtreaksetmessages: + msg356645
2019-11-15 04:58:09benjamin.petersonsetstatus: open -> closed
resolution: fixed
stage: patch review -> resolved
2019-11-15 03:38:10blueyedsetnosy: + blueyed
messages: + msg356644
2019-02-27 06:43:33Anthony Sottilesetkeywords: + patch
stage: patch review
pull_requests: + pull_request12088
2019-02-27 04:44:09xtreaksetnosy: + xdegaye, xtreak
2019-02-27 03:46:52Anthony Sottilecreate