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

Pythass report at bugs.python.org
Sun Mar 13 04:29:17 EDT 2022


New submission from Pythass <crazysnob at live.it>:

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 is attached at the ticket.

Examples of triggering "expected one argument" error:
python test.py -u -1:00
python test.py -u -1:

Examples of NON triggering "expected one argument" error:
python test.py -u -1
python test.py -u=-1:00

----------
components: Parser
files: test.py
messages: 415031
nosy: Pythass, lys.nikolaou, pablogsal
priority: normal
severity: normal
status: open
title: argparse - "expected one argument" when used -: in argument
type: compile error
versions: Python 3.10
Added file: https://bugs.python.org/file50668/test.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue47002>
_______________________________________


More information about the New-bugs-announce mailing list