【发布时间】:2022-07-18 16:20:00
【问题描述】:
简短说明
我正在使用 PyCharm 并且正在编写一个 pytest 单元测试。 我可以正常运行测试,但如果我尝试调试它,调试器就会崩溃。
Windows 致命异常:访问冲突
堆栈跟踪:
线程 0x00003588(最近调用优先): 文件“C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py”,第 324 行等待 文件“C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py”,第 600 行等待 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py”,_on_run 中的第 150 行 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydevd_bundle\pydevd_comm.py”,运行中的第 218 行 文件“C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py”,_bootstrap_inner 中的第 1009 行 文件“C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py”,_bootstrap 中的第 966 行
线程 0x000023f0(最近调用优先): 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydevd_bundle\pydevd_comm.py”,_on_run 中的第 292 行 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydevd_bundle\pydevd_comm.py”,运行中的第 218 行 文件“C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py”,_bootstrap_inner 中的第 1009 行 文件“C:\Users\MyUserName\AppData\Local\Programs\Python\Python310\lib\threading.py”,_bootstrap 中的第 966 行 ... 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev_pydev_imps_pydev_execfile.py”,execfile 中的第 18 行 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py”,_exec 中的第 1483 行 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py”,运行中的第 1476 行 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py”,第 2164 行 文件“C:\Program Files\JetBrains\PyCharm 2021.1\plugins\python\helpers\pydev\pydevd.py”,第 2173 行
进程以退出代码 -1073741819 (0xC0000005) 结束
【问题讨论】:
-
在 raise 语句中添加断点时,问题有些重现
-
对我来说,从 python 3.10 迁移到 3.9 解决了这个问题。