[New-bugs-announce] [issue32036] error mixing positional and non-positional arguments with `argparse`

Stefan Seefeld report at bugs.python.org
Wed Nov 15 11:36:45 EST 2017


New submission from Stefan Seefeld <stefan at seefeld.name>:

I'm trying to mix positional and non-positional arguments with a script using `argparse`, but I observe inconsistent behaviour.
The attached test runs fine when invoked with

test_argparse.py --info a a=b
test_argparse.py a a=b --info

but produces the error `error: unrecognized arguments: a=b` when invoked as

test_argparse.py a --info a=b

Is this intended behaviour ? If yes, is this documented ? If not, is there a way to make this work with existing `argparse` versions ?

----------
components: Library (Lib)
files: test_argparse.py
messages: 306283
nosy: stefan
priority: normal
severity: normal
status: open
title: error mixing positional and non-positional arguments with `argparse`
type: behavior
Added file: https://bugs.python.org/file47268/test_argparse.py

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


More information about the New-bugs-announce mailing list