Message415032
Here's a simplified reproducer:
import argparse
parser = argparse.ArgumentParser()
parser.add_argument("-u", "--utc", choices=["-1:00"])
args = parser.parse_args()
I assume this is related to argparse guessing if an argument is a negative number. See https://stackoverflow.com/questions/9025204/python-argparse-issue-with-optional-arguments-which-are-negative-numbers
From a suggestion there, note that
python test.py -u ' -1:00'
doesn't give the "expected one argument" error. I realize that doesn't solve your problem, but it does shed some light on the issue.
I suspect this can't be fixed without breaking other usages of argparse. |
|
Date |
User |
Action |
Args |
2022-03-13 10:09:13 | eric.smith | set | recipients:
+ eric.smith, paul.j3, Pythass |
2022-03-13 10:09:13 | eric.smith | set | messageid: <1647166153.46.0.686779678467.issue47002@roundup.psfhosted.org> |
2022-03-13 10:09:13 | eric.smith | link | issue47002 messages |
2022-03-13 10:09:13 | eric.smith | create | |
|