Update Pyramid debug template to use `python -m pyramid.scripts.pserve`
See original GitHub issueHi there has been an issue reported before where the “Pyramid” debug option tries to find the wrong pserve on some platforms.
https://github.com/Microsoft/vscode-python/pull/530
The fix was submitted here:
https://github.com/Microsoft/vscode-python/pull/530/commits/f22b4510d22a3e7eb01db5509dc81c83b3f12071
And it added this block of code to fix it, which uses pserve.exe on Windows and pserve on everything else: https://github.com/jpfarias/vscode-python/blob/master/src/client/debugger/Main.ts#L217-L224
I don’t believe this fix was sufficient as today using VSCode 1.26.1 and vscode-python 2018.7.1 I was getting launch error Unable to locate 'pserve.py' required for debugging Pyramid application
Solution for me was to just not try to use the “program” launch style, but instead use the “module” launch style like the “flask” example. I think you guys should consider changing the default to this as it is simpler to understand … and deprecate the custom DebugOption as it is not required nor simpler:
{
"name": "Python: Pyramid",
"type": "python",
"request": "launch",
"module": "pyramid.scripts.pserve",
"args": [
"${workspaceFolder}/development.ini"
],
"debugOptions": [
"RedirectOutput",
]
}
Issue Analytics
- State:
- Created 5 years ago
- Comments:8 (3 by maintainers)
Top GitHub Comments
@brettcannon I’ve got an open PR with some improvements. Please let me know if this hits the mark. Thank you!
This is true but the
if __name__ == '__main__'
support which is required for the-m
option to work was only added in 1.5 but from then on it is a supported way to invoke the console scripts.