[issue9077] argparse does not handle arguments correctly after --

Domen report at bugs.python.org
Fri Jun 25 01:34:58 CEST 2010


New submission from Domen <ielectric at gmail.com>:

Sample code:

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('-v', action='store_true')
>>> parser.add_argument('foo')
>>> parser.parse_args(['-v', '--', '--foo'])
Namespace(foo='--foo', v=True)

>>> parser = argparse.ArgumentParser()
>>> parser.add_argument('-v', action='store_true')
>>> parser.parse_args(['--', '-f'])
usage: [-h] [-v]
: error: unrecognized arguments: -- -f

----------
components: Library (Lib)
messages: 108567
nosy: iElectric
priority: normal
severity: normal
status: open
title: argparse does not handle arguments correctly after --
type: security
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue9077>
_______________________________________


More information about the Python-bugs-list mailing list