On 01.07.2019 12:25, Jeroen Demeyer wrote:
A SystemError is typically raised from C to indicate serious bugs in the application which shouldn't normally be caught and handled. It's used for example for NULL arguments where a Python object is expected. So in some sense, SystemError is the Python equivalent of a segmentation fault.

Since these exceptions should typically not be handled in a try/except Exeption block, I suggest to make SystemError inherit directly from BaseException instead of Exception.

https://docs.python.org/3/library/exceptions.html#SystemError:

Raised when the interpreter finds an internal error, but the situation does not look 
so serious to cause it to abandon all hope. <...>

You should report this to the author or maintainer of your Python interpreter.
For cases where the interpreter deems it too dangerous to continue, there's 
Py_FatalError().

And if it's safe to continue, the exception can be handled -- and since no-one specifically expecs SystemError, will be either logged, or ignored if the author explicitly doesn't mind if the particular code fails -- whether for this reason or any other.

--

Regards,
Ivan
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/5AFZBPYFCUB6JQV4G2OKE36WJVPJ55A3/

Reply via email to