-
Notifications
You must be signed in to change notification settings - Fork 137
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
Debugger doesn't start if LANG is set to non-existent locale #87
Comments
@lorenzo-cavazzi Can you add this debug configuration and try? this will collect debugger logs to python extension directory. Please share all the *.log files, there should be multiple. {
"name": "Debug Test",
"type": "python",
"request": "test",
"console": "integratedTerminal",
"redirectOutput": false,
"logToFile": true
}, |
I get only 1 log per run. |
The warning is fine. This is a hidden property. Can we try another thing? Lets start the debug server externally and connect to it from vscode. From a terminal outside of VS Code, activate the environment that you need and start the debugger like this. This should dump logs to
Remove the previous test configuration with this one: {
"name": "Debug Test",
"type": "python",
"request": "test",
"console": "integratedTerminal",
"redirectOutput": false,
"debugServer": 5678
}, Then start debugging the tests, as you normally do. If things go right you should see logs in your project directory. |
This helped me finding the error! 🎉 Thanks a ton! First time I tried to execute it, I got
So I tried first executing
Trying to start VScode with Is there any better way to fix this in VScode, like a specific setting? |
What's your |
|
We do |
|
Ah, that would explain why it's failing. The correct locale setting should include the encoding, e.g.
while this works fine:
Anyway, the takeaway is that we cannot assume that But you might also want to fix the locale setting anyway, because other apps are likely being affected by it, just not failing so noisily. If it's something that the distro sets automatically, it's a bug on their end - if you file it, the above shell / Python snippets should be enough to demonstrate the problem for a minimal repro without debugpy in the picture. |
…nt locale Ignore errors from setlocale("") instead of failing immediately.
Oh good to know! I'll fix Having a meaningful error in the console/log would have been of great help in this situation, I guess that would also be a good solution if not setting Thanks for helping! 😄 |
I have the same issue, so when I try to fix the settings using:
Am I doing something wrong ? |
@mohdyaser It might be coming from one of the other environment variables - It is also possible that "en_US.UTF-8" is really not a supported locale in your case, e.g. if you're running a minimalistic distro in a container. Locales need to be generated, e.g. using |
Environment data
python.languageServer
setting:"python.languageServer": "Microsoft"
Expected behaviour
Being able to debug pytest and hit breakpoints.
Actual behaviour
When I click on "Debug test", the debug interface quickly starts (I end up in the "Run" tab and I can see the "play", "stop", ... buttons on top right) but it stops after less than a second without hitting the breakpoint and without completing the test.
Using "Run Test" works as expected and the test run and is marked as passed.
Steps to reproduce:
pytest
. I am using https://github.com/SwissDataScienceCenter/renku-pythontest_init_repository
located intests/core/management/test_repository.py
and I put a breakpoint at line 27pytest.ini
we need to comment out line 20 withaddopts
due to known problems with pytest-covDebug Test
P.S: this is my
settings.json
Logs
Output for
Python
in theOutput
panel (View
→Output
, change the drop-down the upper-right of theOutput
panel toPython
)I don't see any output in "Output --> Python" nor in "Python Test Log" after clicking on "Debug test".
When I start VSCode and I select the file containing the test, I see the following
Output from
Console
under theDeveloper Tools
panel (toggle Developer Tools on underHelp
; turn on source maps to make any tracebacks be useful by runningEnable source map support for extension debugging
)Not sure if relevant, but I also add the error I see in "Log Window" -- sometimes only the first of the 2 errors is reported
The text was updated successfully, but these errors were encountered: