paul j3 <ajipa...@gmail.com> added the comment:

The subparser is called with `parse_known_args` which just puts unknown args in 
a _UNRECOGNIZED_ARGS_ATTR attribute slot in the namespace, which is then passed 
back to the main parser.

(this occurs in _SubParsersAction.__call__)

If `parser.parse_known_args` is used, then these arguments will appear in the 
`extras` list.  Otherwise `parser.parse_args` issues the 'unrecognized 
arguments' error message (with the main parser usage).

I suspect this issue has been raised previously.  And I don't see any easy way 
of altering the behavior.

----------
nosy: +paul.j3

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

Reply via email to