Message 340610 - Python tracker

Message340610

Author serhiy.storchaka
Recipients serhiy.storchaka, takluyver
Date 2019-04-21.15:19:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1555859985.43.0.535896029589.issue36691@roundup.psfhosted.org>
In-reply-to
Content
The default handler writes the message of non-integer code to stderr, but in case of '--help', the message should be written to stdout. So this feature is not applicable for it. Are there other examples where this feature can be used?

In such cases it is better to write the message explicitly and call sys.exit() with the required exit code. For tests you can use contextlib.redirect_stderr() (or manually replace sys.stderr) to capture the stderr output.
History
Date User Action Args
2019-04-21 15:19:45serhiy.storchakasetrecipients: + serhiy.storchaka, takluyver
2019-04-21 15:19:45serhiy.storchakasetmessageid: <1555859985.43.0.535896029589.issue36691@roundup.psfhosted.org>
2019-04-21 15:19:45serhiy.storchakalinkissue36691 messages
2019-04-21 15:19:45serhiy.storchakacreate