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.

Title: SystemExit/sys.exit() doesn't print boolean argument
Type: behavior Stage:
Components: Interpreter Core Versions: Python 3.1, Python 3.2, Python 2.7
Status: closed Resolution: not a bug
Dependencies: Superseder:
Assigned To: Nosy List: brandjon, brett.cannon
Priority: normal Keywords:

Created on 2012-01-24 17:42 by brandjon, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Messages (2)
msg151920 - (view) Author: Jon Brandvein (brandjon) Date: 2012-01-24 17:42
Raising SystemExit manually, or calling sys.exit, with an argument of "True" or "False" results in no output to the screen. According to Doc/library/exceptions.rst and Doc/library/sys.rst, any object that is not an integer or None should be printed to stderr.

Also, I'm not sure whether this is a bug, but "raise SystemExit(None)" differs from "sys.exit(None)", in that the former produces an exception with an args tuple of "(None,)", and the latter produces one with an empty args tuple.
msg151950 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2012-01-25 16:48
Thanks for going to the trouble to report this, but this is working as intended since bool is a subclass of int.
Date User Action Args
2022-04-11 14:57:26adminsetgithub: 58061
2012-01-25 16:48:47brett.cannonsetstatus: open -> closed

nosy: + brett.cannon
messages: + msg151950

resolution: not a bug
2012-01-24 17:42:31brandjoncreate