Skip to content

Fix #1898: Windows guard in is_available() compares os.system (a function) to 'nt' — always False - #1923

Closed
vinayK34 wants to merge 1 commit into
httpie:masterfrom
vinayK34:fix/issue-1898-windows-guard
Closed

Fix #1898: Windows guard in is_available() compares os.system (a function) to 'nt' — always False#1923
vinayK34 wants to merge 1 commit into
httpie:masterfrom
vinayK34:fix/issue-1898-windows-guard

Conversation

@vinayK34

Copy link
Copy Markdown

Fixes #1898

The Windows guard in is_available() was broken because it compared os.system (a function) to the string 'nt', which always evaluates to False.

This caused the function to never short-circuit on Windows systems, leading to attempts to run man commands on Windows where they don't exist, resulting in FileNotFoundError exceptions.

Changed the condition from os.system == 'nt' to sys.platform == 'win32' to properly detect Windows systems.

This fix ensures that:

  1. On Windows systems, man pages are properly disabled
  2. The function short-circuits correctly on Windows
  3. No unnecessary attempts are made to run man commands on Windows

…nction) to 'nt' — always False

- Changed `os.system == 'nt'` to `sys.platform == 'win32'` 
- This fixes the Windows detection logic that was previously broken
- The function now properly short-circuits on Windows systems
@vinayK34
vinayK34 marked this pull request as ready for review August 10, 2026 11:26
@vinayK34 vinayK34 closed this by deleting the head repository Aug 10, 2026
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