This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author amansi26
Recipients amansi26
Date 2020-05-28.10:02:25
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1590660145.62.0.878153960448.issue40804@roundup.psfhosted.org>
In-reply-to
Content
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
History
Date User Action Args
2020-05-28 10:02:25amansi26setrecipients: + amansi26
2020-05-28 10:02:25amansi26setmessageid: <1590660145.62.0.878153960448.issue40804@roundup.psfhosted.org>
2020-05-28 10:02:25amansi26linkissue40804 messages
2020-05-28 10:02:25amansi26create