Skip to content

Fix option parsing after request arguments on older Python#1849

Open
mturac wants to merge 2 commits into
httpie:masterfrom
mturac:fix/1838-intermixed-options
Open

Fix option parsing after request arguments on older Python#1849
mturac wants to merge 2 commits into
httpie:masterfrom
mturac:fix/1838-intermixed-options

Conversation

@mturac
Copy link
Copy Markdown

@mturac mturac commented May 17, 2026

Summary

  • use argparse intermixed parsing for HTTPie request arguments
  • keep request items after an output option from being treated as unknown args on Python 3.11/3.12
  • add a regression test for the reported offline verbose command

Fixes #1838.

Tests

  • python3.11 -m pytest tests/test_cli.py -k "IntermixedOptions or no_options"
  • python3.11 -m pytest tests/test_output.py -k "quiet_with_explicit_output_options"
  • python3.11 -m pytest tests/test_cli.py tests/test_output.py
  • python3.11 -m flake8 httpie/cli/argparser.py tests/test_cli.py
  • git diff --check

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.

Inconsistent argument parsing behavior across Python versions (< 3.13 vs 3.13+)

1 participant