Skip to content

[3.12] GH-79714: Add mention of stderr for clarity to ArgumentParser.… #124356

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 2 commits into from
Sep 23, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 4 additions & 4 deletions Doc/library/argparse.rst
Original file line number Diff line number Diff line change
Expand Up @@ -2190,8 +2190,8 @@ Exiting methods
.. method:: ArgumentParser.exit(status=0, message=None)

This method terminates the program, exiting with the specified *status*
and, if given, it prints a *message* before that. The user can override
this method to handle these steps differently::
and, if given, it prints a *message* to :data:`sys.stderr` before that.
The user can override this method to handle these steps differently::

class ErrorCatchingArgumentParser(argparse.ArgumentParser):
def exit(self, status=0, message=None):
Expand All @@ -2201,8 +2201,8 @@ Exiting methods

.. method:: ArgumentParser.error(message)

This method prints a usage message including the *message* to the
standard error and terminates the program with a status code of 2.
This method prints a usage message, including the *message*, to
:data:`sys.stderr` and terminates the program with a status code of 2.


Intermixed parsing
Expand Down
Loading