# Bug report ### Bug description: As reported in [Discourse](https://discuss.python.org/t/about-the-exit-on-error-setting-in-argparse/56702), even though the documentation on the `exit_on_error` argument for `argparse.ArgumentParser` says: > [`exit_on_error`](https://docs.python.org/3/library/argparse.html#exit-on-error) - Determines whether or not `ArgumentParser` exits with error info when an error occurs. (default: `True`) The `parse_args` method would still exit with error info when there are unrecognized arguments: ```python import argparse parser = argparse.ArgumentParser(exit_on_error=False) try: parser.parse_args('invalid arguments'.split()) except argparse.ArgumentError: print('ArgumentError caught.') ``` which outputs: ``` usage: test.py [-h] test.py: error: unrecognized arguments: invalid arguments ``` ### CPython versions tested on: 3.12, CPython main branch ### Operating systems tested on: Linux, Windows <!-- gh-linked-prs --> ### Linked PRs * gh-121019 * gh-121031 * gh-121032 * gh-121056 * gh-121128 * gh-121129 * gh-121510 * gh-121516 <!-- /gh-linked-prs -->