Allow -P to work for debugpy #1759
Replies: 6 comments
|
Karthik Nadig (@karthiknadig) isn't this handled by the extension? Those args are passed to python before running debugpy? |
|
No never mind, they're passed by the launcher. |
That is correct. |
|
Debugpy is passing that argument to debugpy, but it's not running your code. It's running the debugger: Which likely is not your intent. You want I think this would require a custom way to modify the sys.path before starting the app. Or you could modify your use case to use attach and launch your app with -P. |
|
Meaning -P is working as expected: Help from python.org for |
|
Transferring to a discussion for up votes. |

Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
Type: Bug
Behaviour
Expected vs. Actual
Adding the pythonArgs -P or -I to my launch config and call a script in module:
Expected:
Folder of file not in
sys.pathActual:
Folder of file is in
sys.pathSteps to reproduce:
https://github.com/prumand/vscdoe-pythonargs-not-used
Diagnostic data
python.languageServersetting: DefaultOutput for
Pythonin theOutputpanel (View→Output, change the drop-down the upper-right of theOutputpanel toPython)User Settings
Extension version: 2023.14.0
VS Code version: Code 1.81.1 (Universal) (6c3e3dba23e8fadc360aed75ce363ba185c49794, 2023-08-09T22:20:33.924Z)
OS version: Darwin arm64 22.6.0
Modes:
System Info
canvas_oop_rasterization: disabled_off
direct_rendering_display_compositor: disabled_off_ok
gpu_compositing: enabled
metal: disabled_off
multiple_raster_threads: enabled_on
opengl: enabled_on
rasterization: enabled
raw_draw: disabled_off_ok
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
A/B Experiments
All reactions