New submission from amansi26 <amans...@in.ibm.com>:

I am using 3.6.8 version of python.
I am seeing an error as AttributeError: 'Namespace' object has no attribute 
'func' while using argparse . The code is working fine with python2.7 argparser.

I see a similar bug [4] reported at python 3.3 and  python3.4. The workaround 
mentioned works fine for a single level command.
 
Scenarios:
- If there is one command and various subcommands, like [1].The solution works 
fine.
- But suppose I have a command with mutiple level of subcommands like [2]. In 
this case if I give [3] as a command the ArgumentParser.prog() takes just the 
first command as input in this 
  case (open-stack). Hence the parser.print_usage prints [1].
 
 [1] [2] [3]   https://bpa.st/PUPA
 
[4]  https://bugs.python.org/issue16308

----------
messages: 370184
nosy: amansi26
priority: normal
severity: normal
status: open
title: Bug report in python3.6.8 using argparse module
type: behavior
versions: Python 3.6

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

Reply via email to