-
Notifications
You must be signed in to change notification settings - Fork 144
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
Unable to debug pythonw apps on macOS #330
Comments
Can you share your launch.json config? |
Yes, here it is:
I have been digging into the history of releases and this issue started happening matching the change from python.pythonPath to python.interpreterPath (in the may release). However, if I'm not mistaken, the correct setting in the json file would still be pythonpath, so in case I wanted to match my interpreter it would be: |
The canonical name for the setting from debugpy perspective is now just "python" (to avoid confusion with The deprecation of "python.pythonPath" is more complicated than just replacing it with "python.interpreterPath" - see microsoft/vscode-python#11789 on how to handle this correctly. |
The root cause here is very similar to #262. The debug adapter correctly applies "pythonPath" when spawning the launcher; the launcher then uses Problem is, on macOS, The fix will be for the launcher to instead parse "pythonPath" itself, duplicating that logic from the adapter. |
For what it's worth, I have this exact same issue. I also use wxPython and I would love to be able to debug from vs code. My setup is not different enough from OP to really warrant posting a bunch of information but I can provide some if you need anything. Mainly wanted to add a vote asking for this to be fixed :) |
In the launcher, use "python" instead of sys.executable to spawn the debuggee. Update test for "python" / "pythonPath" / "pythonArgs" to use a helper script to assert the use of a custom Python binary; and test -B instead of -v to minimize test log size and run time.
In the launcher, use "python" instead of sys.executable to spawn the debuggee. Update test for "python" / "pythonPath" / "pythonArgs" to use a helper script to assert the use of a custom Python binary; and test -B instead of -v to minimize test log size and run time.
After updating the extension, the debugger doesn't allow debugging pythonw apps anymore. Instead, it tries to launch python, which makes it unusable for wxpython development on MacOS.
Reverting to v2020.3.71659 solves the issue.
Environment data
python.languageServer
setting: XXXExpected behaviour
When debugging a python app with pythonw in the launch.json settings, the debugger should load the file using pythonw.
Actual behaviour
The following error occurs:
Which is simply caused by MacOS not granting access to the screen to python. Normally, this is solved by running apps using pythonw, but the latest versions of the python extension ignore the setting in launch.json.
Steps to reproduce:
Create any wxPython app and try to debug it on a Mac. Example:
This will happen regardless of the "pythonPath" setting in launch.json.
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)The text was updated successfully, but these errors were encountered: