Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

arguments in launch.json is not used when click "Run Python File" button in the top right of the window #21364

Closed
carpetaa opened this issue Jun 4, 2023 · 2 comments
Assignees
Labels
triage-needed Needs assignment to the proper sub-team

Comments

@carpetaa
Copy link

carpetaa commented Jun 4, 2023

Type: Bug

Behaviour

Expected vs. Actual

When I click on the "Debug Python File" button, the arguments in launch.json is used as expectd, however not used when I click on the "Run Python File" button.

Steps to reproduce:

  1. add "purpose" and "args" to launch.json as below
        {
            "name": "Python: test",
            "type": "python",
            "request": "launch",
            "program": "${file}",
            "console": "integratedTerminal",
            "justMyCode": true,
            "purpose": [
                "debug-in-terminal"
            ],
            "args": [
                "/foo/bar/abc.txt"
            ]
        },
  1. create a python file
import sys
print(sys.argv[1])
  1. click the "Run Python File" button in the top right of the window

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)

2023-06-04 11:26:20.439 [info] Send text to terminal: /bin/python /home/chen/scripts/check_arguments.py

User Settings


languageServer: "Pylance"

Extension version: 2023.8.0
VS Code version: Code 1.78.2 (b3e4e68a0bc097f0ae7907b217c1119af9e03435, 2023-05-10T14:39:26.248Z)
OS version: Windows_NT x64 10.0.22621
Modes:
Sandboxed: Yes
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2
Remote OS version: Linux x64 5.15.90.1-microsoft-standard-WSL2

System Info
Item Value
CPUs AMD Ryzen 5 5600 6-Core Processor (12 x 3500)
GPU Status 2d_canvas: enabled
canvas_oop_rasterization: disabled_off
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
video_decode: enabled
video_encode: enabled
vulkan: disabled_off
webgl: enabled
webgl2: enabled
webgpu: enabled
Load (avg) undefined
Memory (System) 15.89GB (6.22GB free)
Process Argv --crash-reporter-id 1d7635f9-8339-4021-9a49-2bf1fec9df83 --crash-reporter-id 1d7635f9-8339-4021-9a49-2bf1fec9df83
Screen Reader no
VM 0%
Item Value
Remote WSL: Ubuntu-20.04
OS Linux x64 5.15.90.1-microsoft-standard-WSL2
CPUs AMD Ryzen 5 5600 6-Core Processor (12 x 3500)
Memory (System) 7.70GB (5.73GB free)
VM 0%
Item Value
Remote WSL: Ubuntu-20.04
OS Linux x64 5.15.90.1-microsoft-standard-WSL2
CPUs AMD Ryzen 5 5600 6-Core Processor (12 x 3500)
Memory (System) 7.70GB (5.73GB free)
VM 0%
A/B Experiments
vsliv368:30146709
vsreu685:30147344
python383cf:30185419
vspor879:30202332
vspor708:30202333
vspor363:30204092
vslsvsres303:30308271
vserr242cf:30382550
pythontb:30283811
vsjup518:30340749
pythonptprofiler:30281270
vsdfh931:30280409
vshan820:30294714
vstes263cf:30335440
vscod805cf:30301675
binariesv615:30325510
bridge0708:30335490
bridge0723:30353136
cmake_vspar411:30581797
vsaa593cf:30376535
pythonvs932:30410667
cppdebug:30492333
vscaat:30438848
vsclangdc:30486549
c4g48928:30535728
dsvsc012:30540252
pynewext54:30695312
azure-dev_surveyone:30548225
vsccc:30610678
2e4cg342:30602488
pyind779:30671433
f6dab269:30613381
pythonsymbol12:30671437
showlangstatbar:30737416
vsctsb:30748421
pythonms35:30701012
a2ce3375:30757347
pythonfmttext:30731395
pythoncmvfstrcf:30756944
fixhidewlkth:30730051
hidesbindicator:30730055
pythongtdpathcf:30739705
pythonnosmt12:30757131

@github-actions github-actions bot added the triage-needed Needs assignment to the proper sub-team label Jun 4, 2023
@carpetaa
Copy link
Author

carpetaa commented Jun 4, 2023

  1. Failed test screen shots
    image
  2. Arguments in launch.json not being used #20396 and Extension not using launch.json config when you press the UI button "Debug Python File" #18199 fixed similiar problem that appeared when clicking "Debug Python File".
  3. this discussion thread How to run with parameters? #20380 describes the exact same problem

@karthiknadig karthiknadig self-assigned this Jun 5, 2023
@karthiknadig
Copy link
Member

Duplicate of #11812

@karthiknadig karthiknadig marked this as a duplicate of #11812 Jun 5, 2023
@karthiknadig karthiknadig closed this as not planned Won't fix, can't repro, duplicate, stale Jun 5, 2023
@github-actions github-actions bot locked as resolved and limited conversation to collaborators Jul 6, 2023
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
triage-needed Needs assignment to the proper sub-team
Projects
None yet
Development

No branches or pull requests

2 participants