Skip to content

Handle ASCII help output streams#1852

Open
puneetdixit200 wants to merge 6 commits into
httpie:masterfrom
puneetdixit200:fix-ascii-help-output
Open

Handle ASCII help output streams#1852
puneetdixit200 wants to merge 6 commits into
httpie:masterfrom
puneetdixit200:fix-ascii-help-output

Conversation

@puneetdixit200
Copy link
Copy Markdown

Fixes #1411.

Summary:

  • Fall back to ASCII-safe escape sequences when argparse help text is written to a strict ASCII stream.
  • Add a regression test for http --help with ASCII-only stdout.

Tests:

  • python -m pytest tests/test_httpie.py::test_help tests/test_httpie.py::test_help_with_ascii_stdout -q
  • python -m pytest tests/test_httpie.py -q
  • python -m pytest tests/test_cli.py -q
  • python -m pytest tests/test_cli_utils.py -q
  • python -m flake8 httpie/cli/argparser.py tests/test_httpie.py
  • git diff --check

@codecov-commenter
Copy link
Copy Markdown

⚠️ Please install the 'codecov app svg image' to ensure uploads and comments are reliably processed by Codecov.

Codecov Report

❌ Patch coverage is 85.71429% with 3 lines in your changes missing coverage. Please review.
✅ Project coverage is 94.10%. Comparing base (4d7d6b6) to head (e3ac637).
⚠️ Report is 383 commits behind head on master.

Files with missing lines Patch % Lines
httpie/cli/argparser.py 70.00% 3 Missing ⚠️
❗ Your organization needs to install the Codecov GitHub app to enable full functionality.
Additional details and impacted files
@@            Coverage Diff             @@
##           master    #1852      +/-   ##
==========================================
- Coverage   97.28%   94.10%   -3.19%     
==========================================
  Files          67      113      +46     
  Lines        4235     7712    +3477     
==========================================
+ Hits         4120     7257    +3137     
- Misses        115      455     +340     

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@puneetdixit200 puneetdixit200 force-pushed the fix-ascii-help-output branch from f85211a to 7b8d933 Compare May 21, 2026 10:29
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.

Help option crash

2 participants