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.

Author bethard
Recipients andersk, bethard, eric.smith, gdb, nelhage, r.david.murray
Date 2010-07-23.11:21:11
SpamBayes Score 0.0005364207
Marked as misclassified No
Message-id <>
Note that the negative number heuristic you're complaining about doesn't actually affect your code below. The negative number heuristic is only used when you have some options that look like negative numbers. See the docs for more information:

Your problem is that you want "--safe" to be treated as a positional argument even though you've declared it as an option. Basically there are two reasonable interpretations of this situation. Consider something like "--conf-file --safe". Either the user wants a conf file named "--safe", or the user accidentally forgot to type the name of the conf file. Argparse assumes the latter, though either one is conceivable. Argparse assumes the latter because, while it occasionally throws an unnecessary exception, the other behavior would allow an error to pass silently.

I'm definitely opposed to changing the default behavior to swallow some errors silently. If you'd like to propose an API for enabling such behavior explicitly and supply a patch and tests implementing it, I'll be happy to review it though.
Date User Action Args
2010-07-23 11:21:14bethardsetrecipients: + bethard, eric.smith, r.david.murray, andersk, gdb, nelhage
2010-07-23 11:21:14bethardsetmessageid: <>
2010-07-23 11:21:12bethardlinkissue9334 messages
2010-07-23 11:21:12bethardcreate