GSTT-CSC / GSTT-CSC/project-template

argparse argument can't have 'type' and "action='store_true'"

Open
#8 0 comments 0 reactions 0 assignees View on GitHub
bug good first issue
Dominant language
Python
Stars
1
Forks
2
PR merge metrics
No merged PRs in 30d

Description

When running:

python run_project.py --help

I get the error:

```
Traceback (most recent call last):
File "run_project.py", line 21, in
help='use localhost flag')
File "/Library/Frameworks/Python.framework/Versions/3.7/lib/python3.7/argparse.py", line 1353, in add_argument
action = action_class(**kwargs)
TypeError: __init__() got an unexpected keyword argument 'type'
```

Looking at the accepted answer on StackOverflow here: https://stackoverflow.com/a/33574480 (and the comment underneath) it seems that the documentation for argparse is misleading and you can't in fact have store_true and type in the same arg.

Deleting `type` for the `-l `argument seems to work.

Contributor guide

No contributing guide indexed for this repository

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.