-
Notifications
You must be signed in to change notification settings - Fork 49
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
Improving the presentation of exceptions within in-process runs #156
Comments
python -c <shim>
rather than python <path-to-in_process.py>
FWIW, I wouldn't mind if alternatively we rewrote the exception's traceback before re-raising it to be something like:
That won't require a reworking of our subprocess invocation mechanism and instead be a code-only change within in_process.py. |
However, #148 appeared to have a problem with the file being named as |
Well, most tools that I use nowadays are smart enough to recognise shebangs to syntax highlight things correctly + gimme code completion and all that fun stuff. :) |
FWIW, here's a link to the somewhat-extensive shim that pip uses: https://github.com/pypa/pip/blob/ba0e3ac6f4f0f396c02ae248c599205b98d184aa/src/pip/_internal/utils/setuptools_build.py#L8 |
🤷 Honestly, I don't care that much. I've just seen people ask for this type of change in both directions (on various projects), which suggests to me that there's no strong arguments in either direction (and so generally "status quo wins" in my mind). |
Well, you and I are in the same camp then. :) |
One of the things I'm thinking of (but haven't actioned on in any way, so far) is adopting something similar to pip's setuptools shim in this project. With that, we'd basically be passing the runner-code as a string and calling it within an
exec()
call within a runner shim.Basically, that changes the tracebacks from...
to:
This might also help with #148, assuming we treat the current
in_process
code as "data" within the package (which is a reasonable thing to do).The text was updated successfully, but these errors were encountered: