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 r1kk3r
Recipients paul.j3, petr.viktorin, r1kk3r, rhettinger, xtreak
Date 2020-08-24.15:02:10
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1598281330.9.0.615377140864.issue41534@roundup.psfhosted.org>
In-reply-to
Content
Another issue:

parser = argparse.ArgumentParser(allow_abbrev=False)
parser.add_argument('-verbose', type=int, required=True, dest="bla", help="bla")
known_args, rest_of_args = parser.parse_known_args(["-v", "-verbose=2"])

With python 3.8.5

test.py: error: argument -verbose: expected one argument

With python 3.7.8

<no error>


This is really annoying. Argparse tries to do "smart" things where it shouldn't. I want it to parse -verbose, I never told him that -v is an alias for -verbose...
History
Date User Action Args
2020-08-24 15:02:10r1kk3rsetrecipients: + r1kk3r, rhettinger, petr.viktorin, paul.j3, xtreak
2020-08-24 15:02:10r1kk3rsetmessageid: <1598281330.9.0.615377140864.issue41534@roundup.psfhosted.org>
2020-08-24 15:02:10r1kk3rlinkissue41534 messages
2020-08-24 15:02:10r1kk3rcreate