classification
Title: import error when in python -m pdb debug mode
Type: behavior Stage:
Components: Windows Versions: Python 3.7
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: chengyang, paul.moore, steve.dower, tim.golden, xdegaye, zach.ware
Priority: normal Keywords:

Created on 2019-12-15 07:19 by chengyang, last changed 2019-12-21 13:27 by xdegaye.

Files
File name Uploaded Description Edit
myfilesort.py chengyang, 2019-12-15 07:19
Messages (2)
msg358412 - (view) Author: chengyang (chengyang) Date: 2019-12-15 07:19
D:\data\mypython\photosort 的目录

2019/09/08  15:51    <DIR>          .
2019/09/08  15:51    <DIR>          ..
2019/09/08  15:51                88 myfilesort.py
2019/09/08  15:38               220 myhome.py
2019/12/15  10:44               275 mymain_menu.py
2019/08/22  21:24                39 myphotosort.py
2019/09/08  15:51    <DIR>          siproject
2019/09/08  17:16    <DIR>          __pycache__
               4 个文件            622 字节
               4 个目录 253,973,061,632 可用字节

D:\data\mypython\photosort>python -m pdb myhome.py
> d:\data\mypython\photosort\myhome.py(1)<module>()
-> import os
(Pdb) s
> d:\data\mypython\photosort\myhome.py(2)<module>()
-> import re
(Pdb) s
> d:\data\mypython\photosort\myhome.py(3)<module>()
-> import sys
(Pdb) s
> d:\data\mypython\photosort\myhome.py(4)<module>()
-> sys.path.append('d:\data\mypath\photosort')
(Pdb) s
> d:\data\mypython\photosort\myhome.py(5)<module>()
-> import myfilesort
(Pdb) s
--Call--
> <frozen importlib._bootstrap>(978)_find_and_load()
(Pdb)
msg358770 - (view) Author: Xavier de Gaye (xdegaye) * (Python triager) Date: 2019-12-21 13:27
As a workaround insert the following hard-coded breakpoint before the import statement and run your script with python, i.e. 'python myhome.py' instead of 'python -m pdb myhome.p'.

from pdb import Pdb; Pdb(skip=['importlib*']).set_trace()
History
Date User Action Args
2019-12-21 13:27:10xdegayesetnosy: + xdegaye
messages: + msg358770
2019-12-15 07:19:59chengyangcreate