microsoft / microsoft/vscode-python-debugger

Unable to debug tests: Invalid message: Found duplicate in "env": PATH

オープン
#261 コメント 16 件 リアクション 2 件 担当者 1 名 GitHub で見る

@eleanorjboyd がすでに取り組んでいます。

2025年11月3日 から。

bug good first issue needs PR
主要言語
TypeScript
スター
180
フォーク
126
平均マージ
2日 3時間
マージ済み PR(30日)
3

説明

Type: Bug

Plugin Versions

Python: v2024.2.1
Python Debugger: v2024.2.0

Behaviour

Expected vs. Actual

Expected: When selecting "debug test" from test runner or the editor, the debugger should start.

Actual: Debugger fails to start. Popup dialog with message "Invalid message: Found duplicate in "env": PATH." is displayed.

Steps to reproduce:

  1. Open a new folder in VS Code
  2. Add a single file with a dummy unit test like this:
import unittest


class SomeTest(unittest.TestCase):
    def test_anything(self):
        self.assertTrue(True)
  1. Configure Python tests
  2. Try to debug the test

Diagnostic data

  • Python version (& distribution if applicable, e.g. Anaconda): 3.8.10
  • Type of virtual environment used (e.g. conda, venv, virtualenv, etc.): Global
  • Value of the python.languageServer setting: Default
Output for Python in the Output panel (ViewOutput, change the drop-down the upper-right of the Output panel to Python)

2024-03-12 17:28:25.416 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.421 [debug] starting server as TCP
2024-03-12 17:28:25.421 [debug] starting server as TCP
2024-03-12 17:28:25.423 [info] Using launch configuration in workspace folder.
2024-03-12 17:28:25.423 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.423 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.464 [debug] Activation Commands received undefined for shell cmd, resource c:\UserData\z003emnm\temp\duplicate_env_repro\test1 and interpreter C:\Python38\python.exe
2024-03-12 17:28:25.472 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.473 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.473 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.478 [debug] CreateEnv Trigger - turned off in settings
2024-03-12 17:28:25.616 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.634 [debug] Extension ms-python.debugpy accessed getActiveEnvironmentPath with args: undefined
2024-03-12 17:28:25.639 [debug] Extension ms-python.debugpy accessed resolveEnvironment with args: {"id":"C:\\PYTHON38\\PYTHON.EXE","path":"C:\\Python38\\python.exe"}
2024-03-12 17:28:25.647 [debug] Found cached env for C:\Python38\python.exe
2024-03-12 17:28:25.668 [debug] Extension ms-python.debugpy accessed resolveEnvironment with args: "C:\\Python38\\python.exe"
2024-03-12 17:29:10.882 [debug] Clearing context for python dependencies not installed: ms-python.python.Python
2024-03-12 17:29:10.883 [debug] Found cached env for C:\Python38\python.exe

Output for Python Debugger

``` 2024-03-12 17:26:32.337 [info] Name: Python Debugger 2024-03-12 17:26:32.337 [info] Module: debugpy 2024-03-12 17:27:29.664 [info] DAP Server launched with command: C:\Python38\python.exe c:\Users\z003emnm\.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter 2024-03-12 17:28:25.647 [info] DAP Server launched with command: C:\Python38\python.exe c:\Users\z003emnm\.vscode\extensions\ms-python.debugpy-2024.2.0-win32-x64\bundled\libs\debugpy\adapter ```

User Settings


languageServer: "Pylance"

testing
• unittestArgs: ["-v", "-s", ".", "-p", "test_*.py"]
• unittestEnabled: true

experiments
• enabled: false

Extension version: 2024.2.0
VS Code version: Code 1.87.0 (019f4d1419fbc8219a181fab7892ebccf7ee29a2, 2024-02-27T23:41:44.469Z)
OS version: Windows_NT x64 10.0.19045
Modes:

System Info
Item Value
CPUs 11th Gen Intel(R) Core(TM) i7-11850H @ 2.50GHz (16 x 2496)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: enabled_on
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
skia_graphite: disabled_off
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 31.67GB (19.24GB free)
Process Argv . --crash-reporter-id ad5562b9-4802-4e9d-83ef-990f176f3ed1
Screen Reader no
VM 0%
A/B Experiments
vsliv368cf:30146710
vspor879:30202332
vspor708:30202333
vspor363:30204092
vscoreces:30445986
vscod805cf:30301675
binariesv615:30325510
vsaa593cf:30376535
py29gd2263:30899288
c4g48928:30535728
azure-dev_surveyone:30548225
vscrp:30673768
962ge761:30959799
pythongtdpath:30769146
welcomedialog:30910333
pythonidxpt:30866567
pythonnoceb:30805159
asynctok:30898717
pythontestfixt:30902429
pythonregdiag2:30936856
pyreplss1:30897532
pythonmypyd1:30879173
pythoncet0:30885854
pythontbext0:30879054
accentitlementsc:30887149
dsvsc016:30899300
dsvsc017:30899301
dsvsc018:30899302
pydisww1:30981707
cppperfcontrol:30979541
8082a590:30971561
fegfb526:30981948
bg6jg535:30979843
dsvsc020:30976470

コントリビューションガイド

コントリビューションガイドを開く

はじめの一歩

  1. issue を最後まで読み、次にプロジェクトのコントリビューションガイドを読みます。
  2. 着手することを issue にコメントします — 二人が同じ作業をするのを防げます。
  3. リポジトリをフォークし、ブランチを切って変更します。
  4. issue 番号を参照したプルリクエストを送ります。

評価

この issue はまだ評価されていません。

新しい issue をメールで受け取る

初心者向けの GitHub issue を短くまとめたダイジェスト。