`ModuleNotFoundError` when debugging files in workspace subdirectory
Chưa có ai nhận issue này.
Đánh giá
- Độ khó
- 4/5
- Thời gian dự kiến
- 3-5 ngày
- Mức phù hợp với người mới
- 35/100
Hướng nghiên cứu
Tái hiện lỗi với src/declare.py và src/consume.py bằng cách sử dụng “Debug Python File in WASM” sau khi so sánh với “Run Python File in WASM”. Bắt đầu bằng cách lần theo điểm vào của trình gỡ lỗi cho các thư mục con của workspace và ModuleNotFoundError đã được báo cáo; hoàn tất khi việc gỡ lỗi in “success” trong Debug Console mà không có lỗi import hoặc descriptor.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
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
- Ngôn ngữ chính
- Python
- Star
- 100
- Fork
- 15
- Chỉ số merge pull request
- Không có pull request nào được merge trong 30 ngày
Hướng dẫn đóng góp
Chưa lập chỉ mục được hướng dẫn đóng góp cho kho mã nguồn này
Bắt đầu từ đâu
- Đọc hết issue, rồi đọc hướng dẫn đóng góp của dự án.
- Bình luận trên issue rằng bạn sẽ nhận — tránh hai người làm cùng một việc.
- Fork repository và làm thay đổi trên một nhánh.
- Mở pull request có tham chiếu số hiệu của issue.
Issue khác của microsoft/vscode-python-web-wasm
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 35/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 30/100
-
Độ khó 4/5 3-5 ngày Mức phù hợp với người mới 25/100
-
Độ khó 5/5 Hơn một tuần Mức phù hợp với người mới 25/100
microsoft/vscode-python-web-wasm#42 · 1 bình luận · 1 reaction ·
-
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 48/100
microsoft/vscode-python-web-wasm#37 · 2 reaction ·
Tất cả issue của microsoft/vscode-python-web-wasm
Issue tương tự
-
agent-ready documentation needs-triage
Độ khó 1/5 1-3 giờ Mức phù hợp với người mới 88/100
-
documentation
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 91/100
-
workflow-status page template still says reusable workflows are "triggered only by workflow_call:" Đang mở
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 92/100
-
Add https://search.jeremyh.xyz/ Đang mởinstance instance add
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 72/100
searxng/searx-instances#939 · 1 bình luận ·
-
area-deployment area-integrations triage:bot-seen
Độ khó 2/5 Nửa ngày Mức phù hợp với người mới 86/100