From: Miss Islington (bot) <31488909+miss-islington@users.noreply.github.com> Date: Thu, 10 Oct 2024 18:18:17 +0000 (+0200) Subject: [3.13] Note argparse exit code in documentation (GH-119568) (GH-125274) X-Git-Tag: v3.13.1~335 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=319305c0bf1212d46c8695310af63e3da79ee4be;p=thirdparty%2FPython%2Fcpython.git [3.13] Note argparse exit code in documentation (GH-119568) (GH-125274) (cherry picked from commit 3b87fb74c907510402678bf1b7c4a94df0e5e65a) Co-authored-by: Justin Kunimune Co-authored-by: Savannah Ostrowski --- diff --git a/Doc/library/argparse.rst b/Doc/library/argparse.rst index 0014947d0192..d2705e485c33 100644 --- a/Doc/library/argparse.rst +++ b/Doc/library/argparse.rst @@ -537,7 +537,8 @@ exit_on_error ^^^^^^^^^^^^^ Normally, when you pass an invalid argument list to the :meth:`~ArgumentParser.parse_args` -method of an :class:`ArgumentParser`, it will exit with error info. +method of an :class:`ArgumentParser`, it will print a *message* to :data:`sys.stderr` and exit with a status +code of 2. If the user would like to catch errors manually, the feature can be enabled by setting ``exit_on_error`` to ``False``::