Skip to content

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

Merged
filmor merged 1 commit into
pythonnet:masterfrom
losttech:disallow-shutdown-with-error-set
May 4, 2022
Merged

Disallow runtime shutdown when the Python error indicator is set#1780
filmor merged 1 commit into
pythonnet:masterfrom
losttech:disallow-shutdown-with-error-set

Conversation

@lostmsu

@lostmsu lostmsu commented May 2, 2022

Copy link
Copy Markdown
Member

What does this implement/fix? Explain your changes.

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

Checklist

@filmor

filmor commented May 2, 2022

Copy link
Copy Markdown
Member

Couldn't we just clear it instead?

@lostmsu

lostmsu commented May 2, 2022

Copy link
Copy Markdown
Member Author

@filmor that would be silent information loss.

@filmor

filmor commented May 4, 2022

Copy link
Copy Markdown
Member

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

lostmsu commented May 4, 2022

Copy link
Copy Markdown
Member Author

@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

filmor commented May 4, 2022

Copy link
Copy Markdown
Member

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.

2 participants