Skip to content
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 our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Bypass Unknown Argument: exception? #181

Closed
tt2468 opened this issue Jul 4, 2022 · 1 comment · Fixed by #201
Closed

Bypass Unknown Argument: exception? #181

tt2468 opened this issue Jul 4, 2022 · 1 comment · Fixed by #201

Comments

@tt2468
Copy link

tt2468 commented Jul 4, 2022

I'm working with an application which has to pass arguments to subprocesses. As such, there are upwards of hundreds of possible arguments that could be done as passthrough, but when I try to pass an argument that isn't explicitly defined, parse_args() gives up. I can catch the initial exception, but fetching the arguments later on throw Nothing parsed, no arguments are available..

Is it somehow possible to get argparse to ignore arguments it doesn't recognize?

@skrobinson
Copy link
Contributor

No, argparse will not ignore unrecognized arguments since v1.6.

I recommend leaving this issue open. Someone may see this and decide to add parse_known_args.

p-ranav added a commit that referenced this issue Sep 21, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants