Skip to content

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

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

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

Conversation

@vinayK34

Copy link
Copy Markdown

Fixes #1898

The bug was in httpie/output/ui/man_pages.py where os.system == 'nt' was always False because os.system is a function object, not a string. This prevented the Windows guard from working properly.

Changed the condition to sys.platform == 'win32' which is the correct way to detect Windows platforms.

This ensures that on Windows systems, man pages are properly disabled and won't attempt to execute the man command (which doesn't exist on Windows).

…to 'nt' — always False

- Fixed the bug where `os.system == 'nt'` was always False because os.system is a function
- Changed to use `sys.platform == 'win32'` which is the correct way to detect Windows platforms
- Added missing import for sys module
- This ensures man pages are properly disabled on Windows systems
@vinayK34
vinayK34 marked this pull request as ready for review August 10, 2026 12:18
@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