[issue47002] argparse - "expected one argument" when used -: in argument

2022-03-13 Thread Pythass
Pythass added the comment: The curious aspect is that for: import argparse parser = argparse.ArgumentParser() parser.add_argument("-u", "--utc", choices=["-1"]) args = parser.parse_args() it works. But if we use the colon (:) character as: import argparse pa

[issue47002] argparse - "expected one argument" when used -: in argument

2022-03-13 Thread Pythass
New submission from Pythass : By using argparse, and by passing a string as argument that has both a dash "-" and colon ":", python returns "expected one argument" error, despite it works when I use only "-" without ":". An example of code