[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-22 Thread Денис Кореневский
Денис Кореневский 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

[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-17 Thread Денис Кореневский
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

[issue22433] Argparse considers unknown optional arguments with spaces as a known positional argument

2014-09-17 Thread Денис Кореневский
Денис Кореневский 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