Skip to content

Fix Windows guard in man page availability check#1900

Open
yoshibase wants to merge 1 commit into
httpie:masterfrom
yoshibase:fix/issue-1898-windows-man-pages-guard
Open

Fix Windows guard in man page availability check#1900
yoshibase wants to merge 1 commit into
httpie:masterfrom
yoshibase:fix/issue-1898-windows-man-pages-guard

Conversation

@yoshibase

@yoshibase yoshibase commented Jul 15, 2026

Copy link
Copy Markdown

Summary

Fixes #1898.

is_available() compared the os.system function object to "nt", so the intended Windows short-circuit could never run. Use sys.platform == "win32" and cover every return path.

Test plan

  • pytest tests/test_man_pages.py — 5 passed
  • flake8 httpie/output/ui/man_pages.py tests/test_man_pages.py
  • Windows guard, HTTPIE_NO_MAN_PAGES, successful/failed man, and execution-error paths covered

@yoshibase
yoshibase force-pushed the fix/issue-1898-windows-man-pages-guard branch 3 times, most recently from 56d28ff to 6f982a9 Compare July 25, 2026 04:11
Use sys.platform instead of comparing the os.system function to a string, and cover the guard and subprocess outcomes.

Fixes httpie#1898
@yoshibase
yoshibase force-pushed the fix/issue-1898-windows-man-pages-guard branch from 6f982a9 to f84b3ce Compare July 25, 2026 04:16
@yoshibase

Copy link
Copy Markdown
Author

CI note after the clean rebuild: tests/test_man_pages.py passes all 5 cases and flake8 is clean. The current PR is only the man-page guard plus its focused test file.

The coverage failure is the same pre-existing Big5 detection failure in tests/test_encoding.py seen on upstream master (for example run 28435490851); the new man-page tests report 100% coverage.

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.

Bug: Windows guard in is_available() compares os.system (a function) to 'nt' — always False

1 participant