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

Correct handling of arguments that take values. #2027

Closed
wants to merge 1 commit into from

Conversation

freakboy3742
Copy link
Member

Python 3.12.7 modified the handling of command line arguments in a way that broke Briefcase's handling of arguments that take values (e.g., -C <config=value>, -d <device>, etc).

Briefcase's command line handling is based on pushing argparse to its limits, performing partial parsing of arguments before all options have been registered. This is needed to allow commands to register their own arguments, and for the help for commands to be responsive to the target platform and output format.

The parser also has 2 optional positional arguments for most commands (platform and output_format). Because they're optional, there's an ambiguity between these positional arguments, and arguments with flags that take values that haven't been registered yet.

This PR takes a quick-and-dirty approach, removing any argument that looks like it might be passing a value from consideration from the partial parse. It's not pretty, but it works.

Fixes #2026.

PR Checklist:

  • All new features have been tested
  • All new features have been documented
  • I have read the CONTRIBUTING.md file
  • I will abide by the code of conduct

@freakboy3742
Copy link
Member Author

Superseded by #2028, which fixes the underlying problem with parsing rather than trying to work around it.

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 this pull request may close these issues.

Handling of options with values broken by Python 3.12.7
1 participant