Parent process venv is not passed through to python subprocesses when using internalConsole
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
Bắt đầu với bản tái hiện được cung cấp bằng test.py và .vscode/launch.json, so sánh internalConsole với integratedTerminal. Theo dõi cách debugpy khởi chạy và chặn các tiến trình con Python, tập trung vào việc truyền PATH và VIRTUAL_ENV. Công việc được xem là hoàn tất khi tiến trình con cowsay chạy dưới internalConsole mà máy chủ không bị ngắt kết nối và không xảy ra lỗi thiếu mô-đun.
Do mô hình lập chỉ mục viết ra từ nội dung của issue.
Mô tả
Configuring "console": "internalConsole" for a launch target causes Python subprocesses spawned by the main debug process to not have their venv inherited correctly.
Repro. steps:
- Create a venv and install
cowsay - Open VS Code in the venv parent dir
- Create files as follows:
test.py:
import subprocess
stdout = subprocess.check_output(["python", "-m", "cowsay", "-t", "test"])
print(stdout.decode())
.vscode/launch.json:
{
"version": "0.2.0",
"configurations": [
{
"name": "Python Debugger: test.py",
"type": "debugpy",
"request": "launch",
"program": "test.py",
"console": "internalConsole", // Doesn't work
// "console": "integratedTerminal", // Works
}
]
}
- Launch the debug target
Actual outcome
- Dialog box with "Server disconnected unexpectedly" displayed
- "No module named cowsay" printed in debug console
Expected outcome
- Subprocess runs without error
Notes
The underlying cause seems to be that the PATH and VIRTUAL_ENV env vars are not inherited correctly in spawned subprocesses when they are intercepted for debugging.
- Ngôn ngữ chính
- Python
- Star
- 2.5k
- Fork
- 202
- Merge trung bình
- 5 ngày 1 giờ
- Pull request đã merge (30 ngày)
- 1
Hướng dẫn đóng góp
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/debugpy
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
Document "rules"-option Đang mởdocumentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 68/100
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 78/100
-
documentation
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 62/100
-
Adapter bootstrap fails with ConnectionRefusedError on WSL2 VirtioProxy or hostAddressLoopback Đang mở
Độ khó 3/5 1-2 ngày Mức phù hợp với người mới 68/100
Tất cả issue của microsoft/debugpy
Issue tương tự
-
[Bug] reef-hermes tells me to resume with hermes --resume, which does not work from my shell Đang mởarea: harness bug status: needs-triage
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
Human-Agent-Society/reef#625 ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 70/100
-
Độ khó 1/5 Dưới một giờ Mức phù hợp với người mới 80/100
learningequality/kolibri#15351 · 2 bình luận ·
-
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
-
Name consistency Đang mở
Độ khó 2/5 1-3 giờ Mức phù hợp với người mới 75/100
eellak/triplestore#65 · 1 bình luận ·