This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: Duplicate content in SystemExit documentation
Type: Stage: resolved
Components: Documentation Versions: Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: berker.peksag, docs@python, martin.panter, python-dev
Priority: normal Keywords: patch

Created on 2015-02-10 12:29 by berker.peksag, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
systemexit.diff berker.peksag, 2015-02-10 12:29 review
systemexit_v2.diff berker.peksag, 2015-03-07 06:59 review
Messages (8)
msg235684 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-10 12:29
From https://docs.python.org/3/library/exceptions.html#SystemExit

    Also, this exception derives directly from BaseException and not Exception, since it is not technically an error.

and

    The exception inherits from BaseException instead of Exception so that it is not accidentally caught by code that catches Exception. This allows the exception to properly propagate up and cause the interpreter to exit.

Here is a patch to remove the duplicate content and document the code attribute properly.
msg235711 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-02-10 21:47
The new text changes “the associated value” to “the value passed to [the] :func:`sys.exit` call”. There seems to be a trend in removing documentation of exception constructor arguments; is this intentional?

In my code I tend to raise SystemExit() directly rather than importing the “sys” module and calling sys.exit().
msg235741 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-02-11 12:42
Good catch, thanks! Do you have better wording for that part of the patch?
msg235799 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-02-12 05:26
How about this:

'''
The constructor accepts the same optional argument passed to :func:`sys.exit`.  If the value is an integer, it specifies the system exit status . . .

. . .

.. attribute:: code

   The exit status or error message that is passed to the constructor. (Defaults to ``None``.)
'''
msg237417 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-03-07 06:59
Thank you for your suggestion, Martin. Here is an updated patch.
msg237419 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-03-07 07:10
New patch looks fine
msg237762 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-03-10 12:46
New changeset 64c0b4aead0f by Berker Peksag in branch '3.4':
Issue #23432: Remove duplicate content from SystemExit docs.
https://hg.python.org/cpython/rev/64c0b4aead0f

New changeset 5163fb8dc61f by Berker Peksag in branch 'default':
Issue #23432: Remove duplicate content from SystemExit docs.
https://hg.python.org/cpython/rev/5163fb8dc61f
msg237763 - (view) Author: Berker Peksag (berker.peksag) * (Python committer) Date: 2015-03-10 12:47
Thanks for the review, Martin.
History
Date User Action Args
2022-04-11 14:58:12adminsetgithub: 67620
2015-03-10 12:47:58berker.peksagsetstatus: open -> closed
resolution: fixed
messages: + msg237763

stage: patch review -> resolved
2015-03-10 12:46:51python-devsetnosy: + python-dev
messages: + msg237762
2015-03-07 07:10:54martin.pantersetmessages: + msg237419
2015-03-07 06:59:55berker.peksagsetfiles: + systemexit_v2.diff

messages: + msg237417
2015-02-12 05:26:19martin.pantersetmessages: + msg235799
2015-02-11 12:42:51berker.peksagsetmessages: + msg235741
2015-02-10 21:47:17martin.pantersetnosy: + martin.panter
messages: + msg235711
2015-02-10 12:29:15berker.peksagcreate