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

Disallow runtime shutdown when the Python error indicator is set #1780

Merged
merged 1 commit into from May 4, 2022

Conversation

lostmsu
Copy link
Member

@lostmsu lostmsu commented May 2, 2022

What does this implement/fix? Explain your changes.

Shutting down runtime when the Python error indicator is set has unpredictable behavior.

Checklist

@filmor
Copy link
Member

filmor commented May 2, 2022

Couldn't we just clear it instead?

@lostmsu
Copy link
Member Author

lostmsu commented May 2, 2022

@filmor that would be silent information loss.

@filmor
Copy link
Member

filmor commented May 4, 2022

This way will probably lead to a lot more unwanted behaviour in that a program that ends with Shutdown will not have its resources closed if an error is still set (as it will just crash on this exception), or am I misunderstanding something?

@lostmsu
Copy link
Member Author

lostmsu commented May 4, 2022

@filmor if they are at this point, they already have an unhandled exception. Generally speaking it is better to crash, than to try to close resources as you might persist a corrupted state and not get notified about it at all.

@filmor
Copy link
Member

filmor commented May 4, 2022

Hmm, I'll tentatively agree with this, let's see whether someone complains :)

@filmor filmor merged commit a80c685 into pythonnet:master May 4, 2022
@lostmsu lostmsu deleted the disallow-shutdown-with-error-set branch May 4, 2022 18:11
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants