【发布时间】:2021-05-12 20:44:01
【问题描述】:
老实说,我不知道我在看什么。
当我开始调试时,我在这个 VSCode 项目(一个 Discord 机器人)中的调试配置突然出现了错误。正常运行程序时不会这样,在其他项目中调试好像没问题。
大约 50% 的情况下,尽管出现错误并且调试工作正常,但它最终会连接到 Discord,但其他时候程序会挂起并拒绝连接到 Discord。
这是错误文本,我很抱歉转储了这么多代码,但我不知道这是否重要:
'c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\launcher' '51717' '--' 'bot/bot.py'
pydev debugger: critical: unable to get real case for file. Details:
filename: bot
drive:
parts: ['bot']
(please create a ticket in the tracker to address this).
Traceback (most recent call last):
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 221, in _get_path_with_real_case
return _resolve_listing(drive, iter(parts))
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 226, in _get_path_with_real_case
return _resolve_listing(drive, iter(parts))
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
pydev debugger: critical: unable to get real case for file. Details:
filename: bot
drive:
parts: ['bot']
(please create a ticket in the tracker to address this).
Traceback (most recent call last):
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 221, in _get_path_with_real_case
return _resolve_listing(drive, iter(parts))
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 226, in _get_path_with_real_case
return _resolve_listing(drive, iter(parts))
File "c:\Users\Lucas\.vscode\extensions\ms-python.python-2021.5.829140558\pythonFiles\lib\python\debugpy\_vendored\pydevd\pydevd_file_utils.py", line 184, in _resolve_listing
dir_contents = cache[resolved_lower] = os.listdir(resolved)
FileNotFoundError: [WinError 3] The system cannot find the path specified: ''
我已经在错误中提到的tracker 上发布了一张票,但老实说,我不知道 PyDev 是什么,或者是否有办法重新安装它并解决问题。
有什么解决方法吗?我真的不知道我在问什么纯粹是因为这对我来说太陌生了,但这只是那些似乎没有任何真正原因自发发生的错误之一。
【问题讨论】:
-
没有承诺,但试试这个(类似的事情发生在我身上,我能够用以下方法解决它)。你在为你的 Python 调试使用配置吗?在
./vscode/launch.json下,您将拥有工作区的现有调试配置。如果没有,请设置一个。直到几天前,我的program使用./main.py都没有问题(看来您使用了bot),但更新后出现错误。尝试使用 ${workspaceFolder}\\ 以及正确的文件名和位置将其更改为"program": "${workspaceFolder}\\bot.py",然后看看你的情况。如果这没有帮助,请粘贴您的launch.json -
@Woodsy 我不知道如何解决这个问题。非常感谢。
-
很高兴听到这个消息!如果您能在下面接受我的回答,那就太好了:)
标签: python python-3.x visual-studio-code pydev