Uh oh!
There was an error while loading. Please reload this page.
Add support for pydevd debugging of modules - #75
Conversation
Uh oh!
There was an error while loading. Please reload this page.
etanshaul
commented
May 17, 2021
curious in general - does VSC already support debugging modules (via ptvsd/debugpy)? |
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
etanshaul
commented
May 17, 2021
LGTM. review became easy after you showed the command sequence above. just a comment to add those details somewhere as a comment in the code. |
| switch { | ||
| case len(args) == 0: | ||
| return "", nil, fmt.Errorf("no python command-line specified") // shouldn't happen | ||
| case !strings.HasPrefix(args[0], "-"): |
There was a problem hiding this comment.
what if it's something like python -[some-other-flag] app.py? is this not valid? In that case it wouldn't be recognized as a file
There was a problem hiding this comment.
if I update my entrypoint to this ENTRYPOINT ["python", "-E", "app.py"] debug suddenly breaks (it works without the -E flag. And non-debug mode works with either.
There was a problem hiding this comment.
update: I may have been wrong here. running another test. will update this comment
update 2: nevermind, looks like my observation above was correct.
There was a problem hiding this comment.
It does break. That's going to be more involved — I'll do tackle it as a follow-up.
This PR builds on #74 and adds support for debugging Python modules (e.g.,
python -m flask) withpydevd. Just look at ef3a44apydevd ... --file xxxexpects the--fileargument to be a file. This patch causes the python launcher to create a small launch script that uses Python'srunpysupport to launch the module.