Disallow runtime shutdown when the Python error indicator is set by lostmsu · Pull Request #1780 · pythonnet/pythonnet

Conversation

@lostmsu

What does this implement/fix? Explain your changes.

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

Checklist

…it may lead to unpredictable behavior

@filmor

Couldn't we just clear it instead?

@lostmsu

@filmor that would be silent information loss.

@filmor

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

@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

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

@lostmsu lostmsu deleted the disallow-shutdown-with-error-set branch

May 4, 2022 18:11

2 participants

@lostmsu @filmor