[issue6498] Py_Main() does not return on SystemExit

Mark Hammond report at bugs.python.org
Mon Mar 28 09:02:42 CEST 2011


Mark Hammond <skippy.hammond at gmail.com> added the comment:

Note the quoted documentation in comment 1, the paragraph "Note that if an otherwise unhandled SystemError ..."

I don't think that paragraph is correct - SystemError doesn't seem to terminate Py_Main - but if you replace "SystemError" with "SystemExit", that paragraph is correct, including the comment about Py_InspectFlag.

So I think there are 2 simple documentation bugs (the component of this bug is "Documentation") and not necessarily a behaviour bug (even though the "type" is set to behaviour :)

* The first paragraph should have references to sys.exit() removed (I didn't mention this in my previous comment!)

* The second paragraph should s/SystemError/SystemExit/ and optionally a note that calling sys.exit() will result in a SystemExit exception.

I just traced through this in Python 2.6 - PyRun_InteractiveOneFlags winds up calling PyErr_PrintEx() and this function explicitly checks for SystemExit and calls handle_system_exit, which calls exit().  There doesn't seem to be any special handling for SystemError at all.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6498>
_______________________________________


More information about the Python-bugs-list mailing list