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 paul.j3
Recipients Pythass, eric.smith, paul.j3, rhettinger, xtreak
Date 2022-03-13.20:39:33
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1647203973.91.0.452197067849.issue47002@roundup.psfhosted.org>
In-reply-to
Content
'-1' and '-1.23' are recognized as numbers, and treated as arguments.  '-1' requires some special handling because it is allowed as a flag, as in

    parser.add_argument('-1','--one')

'-1:00' on the other hand is no different from a string like '-foo'.  Default is to parse it as a flag.  If you don't get this error

    argument -f: expected one argument

you are likely to get:

    error: unrecognized arguments: -1:23

This can probably be closed as a duplicate of:

https://bugs.python.org/issue9334
argparse does not accept options taking arguments beginning with dash (regression from optparse)
History
Date User Action Args
2022-03-13 20:39:33paul.j3setrecipients: + paul.j3, rhettinger, eric.smith, xtreak, Pythass
2022-03-13 20:39:33paul.j3setmessageid: <1647203973.91.0.452197067849.issue47002@roundup.psfhosted.org>
2022-03-13 20:39:33paul.j3linkissue47002 messages
2022-03-13 20:39:33paul.j3create