Skip to content

Conversation

hroncok
Copy link
Contributor

@hroncok hroncok commented Jul 10, 2025

Python started raise early errors for invalid help strings, effectively triggering our LazyChoices action to query the options when added.

By using a custom ArgumentParser subclass that disables this check, LazyChoices works as intended.

Note that in real httpie code,
all argument parsing is done via BaseHTTPieArgumentParser subclasses, so this fixes the problem in httpie as well as in the tests.

Directly using BaseHTTPieArgumentParser in test_lazy_choices_help is not trivial, as it would require more setup.

Fixes #1641

Python started raise early errors for invalid help strings,
effectively triggering our LazyChoices action to query the options
when added.

By using a custom ArgumentParser subclass that disables this check,
LazyChoices works as intended.

Note that in real httpie code,
all argument parsing is done via BaseHTTPieArgumentParser subclasses,
so this fixes the problem in httpie as well as in the tests.

Directly using BaseHTTPieArgumentParser in test_lazy_choices_help
is not trivial, as it would require more setup.

Fixes httpie#1641
@hroncok
Copy link
Contributor Author

hroncok commented Jul 10, 2025

Python 3.7 CI is failing because that Python is no longer available.

@hroncok
Copy link
Contributor Author

hroncok commented Jul 10, 2025

test_cli_utils.py seems to pass. All the other failures are unrelated.

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.

test_lazy_choices_help fails on Python 3.14
1 participant