`ModuleNotFoundError` when debugging files in workspace subdirectory
还没有人认领这个 Issue。
评估
调研方向
使用“Debug Python File in WASM”复现 src/declare.py 和 src/consume.py 的失败,并将其与“Run Python File in WASM”进行比较。首先跟踪 workspace 子目录的调试器入口点以及报告的 ModuleNotFoundError;当调试在 Debug Console 中输出“success”且没有 import 或 descriptor 错误时,即表示完成。
由索引模型根据 Issue 内容生成。
描述
Code Snippet
src/declare.py
def func():
return "success"
src/consume.py
from declare import func
print(func())
Repro Steps
- Create files as above. Note that they are in the
srcsubdirectory of the workspace. - Open workspace root (parent of
src) inhttps://insiders.vscode.dev/?vscode-coi= - Open
consume.py - "Run Python File in WASM"
- Note that "success" is printed in the program output (Terminal pane)
- "Debug Python File in WASM"
- When debugger stops at top of file, press the "Continue" button in the debugging toolbar.
Expected behavior
Code runs successfully again and prints "success" in the program output (Debug Console pane)
Actual behavior
No "success" in program output. "Debug Console" shows the errors below. I think the "Bad file descriptor" may be a known issue, but note the ModuleNotFoundError.
If you move the two files from src to the workpace root, the code works as expected while debugging.
On desktop the code works as expected with the files in either location.
PDB debugger connected.
Traceback (most recent call last):
File "/$debug/main.py", line 12, in run
dbg._run(tgt)
File "/lib/python3.11/pdb.py", line 1646, in _run
self.run(target.code)
File "/lib/python3.11/bdb.py", line 597, in run
exec(cmd, globals, locals)
File "<string>", line 1, in <module>
File "/workspace/src/consume.py", line 1, in <module>
from declare import func
ModuleNotFoundError: No module named 'declare'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "/$debug/main.py", line 31, in <module>
run(debugger, target)
File "/$debug/main.py", line 25, in run
dbg.interaction(None, t)
File "/lib/python3.11/pdb.py", line 434, in interaction
self.print_stack_entry(self.stack[self.curindex])
File "/lib/python3.11/pdb.py", line 1553, in print_stack_entry
self.message(prefix +
File "/lib/python3.11/pdb.py", line 535, in message
print(msg, file=self.stdout)
OSError: [Errno 8] Bad file descriptor
- 主要语言
- Python
- 星标
- 100
- 派生
- 15
- PR 合并指标
- 30 天内没有已合并 PR
环境准备
我们还没有检查这个项目的环境配置文件。先看它的 README,通用步骤见我们的新手贡献指南。
从这里开始
- 先读完整个 Issue,再读项目的贡献指南。
- 在 Issue 下留言说明你要接手 —— 这能避免两个人做同样的事。
- Fork 仓库,在一个分支上完成修改。
- 提交 Pull Request,并在描述里引用这个 Issue 编号。
microsoft/vscode-python-web-wasm 的其他 Issue
-
难度 3/5 1-2 天 新手友好度 35/100
-
难度 4/5 3-5 天 新手友好度 30/100
-
难度 4/5 3-5 天 新手友好度 25/100
-
难度 5/5 一周以上 新手友好度 25/100
microsoft/vscode-python-web-wasm#42 · 1 条评论 · 1 个 reaction ·
-
难度 3/5 1-2 天 新手友好度 48/100
microsoft/vscode-python-web-wasm#37 · 2 个 reaction ·
查看 microsoft/vscode-python-web-wasm 的全部 Issue
相似的 Issue
-
难度 2/5 1-3 小时 新手友好度 78/100
solana-foundation/pay-kit#341 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 78/100
nasa/python_cmr#123 ·
-
难度 1/5 1 小时以内 新手友好度 92/100
EleutherAI/lm-evaluation-harness#4243 ·
维护者通常 1 天内回复
-
area: dashboard bug perceived difficulty: 3
难度 2/5 1-3 小时 新手友好度 88/100
Nitjsefnie-Harness-Commons/daedalus#1179 ·
维护者通常 1 天内回复
-
难度 2/5 1-3 小时 新手友好度 88/100
cusp-ai-oss/tojax#17 ·