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.

Title: Bug report in python3.6.8 using argparse module
Type: behavior Stage: resolved
Components: Versions: Python 3.6
Status: closed Resolution: rejected
Dependencies: Superseder:
Assigned To: Nosy List: DahlitzFlorian, amansi26, iritkatriel, remi.lapeyre, terry.reedy
Priority: normal Keywords:

Created on 2020-05-28 10:02 by amansi26, last changed 2022-04-11 14:59 by admin. This issue is now closed.

Messages (4)
msg370184 - (view) Author: (amansi26) Date: 2020-05-28 10:02
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.
- 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]
msg370187 - (view) Author: Rémi Lapeyre (remi.lapeyre) * Date: 2020-05-28 10:38
Hi amansi26, thanks for reporting this issue.

Without an example program that reproduces it, we won't be able to diagnose and fix it thought. Can you post one?
msg370354 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2020-05-30 02:45
3.6 has only gotten security fixed for 1.5 years.  We need a test file that can be run as is in the master branch to see if there is a current bug.
msg391105 - (view) Author: Irit Katriel (iritkatriel) * (Python committer) Date: 2021-04-14 22:32
amansi26, I am closing this because you did not reply to the request for more information for almost a year. Also, the link in your comment is not working anymore. 

If you are still having a problem with argparse, please open a new issue for it and include code that demonstrates the problem.

There is some documentation on bug reporting that might be helpful:
Date User Action Args
2022-04-11 14:59:31adminsetgithub: 84981
2021-04-14 22:32:01iritkatrielsetstatus: open -> closed

nosy: + iritkatriel
messages: + msg391105

resolution: rejected
stage: resolved
2020-05-30 02:45:41terry.reedysetnosy: + terry.reedy
messages: + msg370354
2020-05-28 11:40:09DahlitzFloriansetnosy: + DahlitzFlorian
2020-05-28 10:38:10remi.lapeyresetnosy: + remi.lapeyre
messages: + msg370187
2020-05-28 10:02:25amansi26create