Jason R. Coombs added the comment:

I also ran into this problem. I put together this script to reproduce the issue:

import argparse

parser = argparse.ArgumentParser()
parser.add_argument('app')
parser.add_argument('--config')
parser.add_argument('app_args', nargs=argparse.REMAINDER)
args = parser.parse_args(['app', '--config', 'bar'])
print vars(args)
# actual: {'app': 'app', 'app_args': ['--config', 'bar'], 'config': None}
# expected: {'app': 'app', 'app_args': [], 'config': 'bar'}

I'll try using parse_known_args instead.

----------
nosy: +jason.coombs

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue14174>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to