- Notifications
You must be signed in to change notification settings - Fork673
Check for action arg before use (fix Python 3 error)#79
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to ourterms of service andprivacy statement. We’ll occasionally send you account related emails.
Already on GitHub?Sign in to your account
Uh oh!
There was an error while loading.Please reload this page.
Conversation
Check that the parsed `action` attribute exists before using it.Previously, whenever the command-line tool was invoked on Python 3.4without a bare-word argument, which is expected to be the action, theprogram aborts with an AttributeError in cli.py on the line assigning`arg.action` to `action`: AttributeError: 'Namespace' object has no attribute 'action'
Could you give an example of a command that would generate this error? Thanks. |
This issue occurs whenever there is no positional ("bareword") argument given to the program. For instance, with no arguments at all
It will also occur if you provide option arguments, but still don't provide a positional argument (one that is not an option flag) as in
This test was performed with the#78 ( |
I just push commit7c38ef6 which should fix for this bug. It uses the argparse features instead of providing a custom test. Could you test it to make sure it behaves as you would expect? Thanks. |
Verified fixed with commit7c38ef6. Thanks. |
Check that the parsed
action
attribute exists before using it.Previously, whenever the command-line tool was invoked on Python 3.4
without a bare-word argument, which is expected to be the action, the
program aborts with an AttributeError in cli.py on the line assigning
arg.action
toaction
: