Skip to content
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

Enforce PSUTIL_DEBUG #1395

Closed
giampaolo opened this issue Jan 24, 2019 · 2 comments
Closed

Enforce PSUTIL_DEBUG #1395

giampaolo opened this issue Jan 24, 2019 · 2 comments

Comments

@giampaolo
Copy link
Owner

giampaolo commented Jan 24, 2019

In #1173 we introduced PSUTIL_DEBUG environment variable which can be set in order to print more information on stderr in order to understand where in the C code an error originates from in case of exception. #1394 is an example of how this would be useful, but in that case proc_exe C function does not print any debug message. The task is to extend this paradigm to more (possibly all?) C functions/code.

@giampaolo
Copy link
Owner Author

Note to self: even if a bit unorthodox, a different way to approach this would be using PyErr_SetFromWindowsErrWithFilename instead, and instead of the filename str we pass a useful message, like the name of the syscall which failed.

@giampaolo
Copy link
Owner Author

I opted for implementing the PyErr_SetFromWindowsErrWithFilename trick on Windows only in #1428. Other platforms just raise the usual OSError but the traceback message is changed (inlcudes the syscall). Closing this out as outdated.

@giampaolo giampaolo added bug and removed bug labels Nov 15, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant