-
Notifications
You must be signed in to change notification settings - Fork 750
Failure to initialize halts/crashes your program #1534
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
Comments
Similar to #1478, but this issue is specifically about the fact that the program crashes out from underneath you. I need to display an error to the user and let them continue working. |
This is probably impossible to fix from our side, as the termination is initiated by Python. You could try to spawn a subprocess with parameters specified by user to validate them by checking the exit code. |
@lostmsu thank you for your response. I certainly understand your point and would probably do the same myself. I'd like to submit this issue to CPython, but as Python.net intends to be an abstraction layer to hide the CPython internals from the .NET developer it is unclear exactly what internal APIs of CPython it is using to initialize. As an aside, it seems like having a better error reporting mechanism would be beneficial Python.net. If instead of just crashing underneath you an explicit error were returned users might be able to self-solve issues like #1478 without needing to submit support issues. Would you be able to at least point me at the specific call into the CPython API that is ultimately failing? If not, I understand. Thank you again for the great project! |
@phxnsharp some exceptions can not be handled in .NET, including pretty much anything Python initialization process might raise. Your repro code pretty much demonstrates that. |
Environment
Details
Describe what you were trying to get done.
Start using Python from a .NET application
What commands did you run to trigger this issue? If you can provide a
Minimal, Complete, and Verifiable example
this will help us understand the issue.
If your PYTHONHOME or PYTHONPATH information is incorrect, your program will just suddenly not be running. No exceptions are raised or presented to the .NET code. This is non-starter for us. Our program is a long-lived process that might at times need to call into custom Python code written by our users. The user must be able to control the PYTHONHOME and PYTHONPATH. If they get this configuration wrong, the program appears to dump some information to the console, and then the whole program exits.
None is given. The program just suddenly exits. The debug console shows:
The text was updated successfully, but these errors were encountered: