`ModuleNotFoundError` when debugging files in workspace subdirectory
まだ誰も着手していません。
評価
調査の方向性
“Run Python File in WASM” と比較したうえで、“Debug Python File in WASM” を使用して src/declare.py と src/consume.py で失敗を再現します。まず、workspace のサブディレクトリに対するデバッガーのエントリーポイントと、報告された ModuleNotFoundError を追跡します。デバッグ時に import エラーや descriptor エラーなしで Debug Console に “success” と出力されれば完了です。
索引モデルが 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 はありません
コントリビューションガイド
このリポジトリのコントリビューションガイドは索引されていません
はじめの一歩
- issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
- 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
- リポジトリをフォークし、ブランチを切って変更します。
- 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 1週間以上 初心者へのやさしさ 25/100
microsoft/vscode-python-web-wasm#42 · コメント 1 件 · リアクション 1 件 ·
-
難易度 3/5 1〜2日 初心者へのやさしさ 48/100
microsoft/vscode-python-web-wasm#37 · リアクション 2 件 ·
microsoft/vscode-python-web-wasm の issue をすべて見る
似ている issue
-
難易度 1/5 1時間未満 初心者へのやさしさ 90/100
-
bug
難易度 2/5 1〜3時間 初心者へのやさしさ 86/100
zostera/django-bootstrap4#894 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 78/100
use-agent-os/agent-os#3276 ·
-
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
zephyrproject-rtos/zephyr#119726 ·
-
area/auth bug comp/agent P3 platform/discord type/security
難易度 2/5 1〜3時間 初心者へのやさしさ 88/100
NousResearch/hermes-agent#117848 ·