Eric V. Smith <e...@trueblade.com> added the comment:

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.

----------
components: +Library (Lib) -Parser
nosy: +eric.smith, paul.j3 -lys.nikolaou, pablogsal

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue47002>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to