Денис Кореневский added the comment:
There is an standard way to solve this ambiguity.
There is a special marker '--' used to force argument parsing function treat
all arguments given in command after this marker as positional arguments. It
was invented specially for tasks where you need
New submission from Денис Кореневский:
Argparse version 1.1 consider ANY unknown argument string containig ' ' (space
character) as positional argument. As a result it can use such unknown optional
argument as a value of known positional argument.
Demonstration code:
import argparse
parser
Денис Кореневский added the comment:
I've signed 'Contributor's Agreement'.
Bug demonstration code listed in issue description is in file attached to
comment.
It can be run with following command:
python argparse_bug_example.py
--
Added file: http://bugs.python.org/file36643