Skip to content

Fix Windows man pages guard (os.system to sys.platform) - #1903

Open
vtino17 wants to merge 2 commits into
httpie:masterfrom
vtino17:fix/man-pages-windows
Open

Fix Windows man pages guard (os.system to sys.platform)#1903
vtino17 wants to merge 2 commits into
httpie:masterfrom
vtino17:fix/man-pages-windows

Conversation

@vtino17

@vtino17 vtino17 commented Jul 21, 2026

Copy link
Copy Markdown

Fixes #1898

Problem

os.system is a function object, so comparing it with "nt" is always false. HTTPie can therefore attempt to invoke man on Windows.

Change

  • use sys.platform == "win32" for the platform guard
  • return before spawning a subprocess on Windows
  • add a regression test proving subprocess.run is not called

Validation

  • focused Windows guard regression: pass
  • code-style check: pass

@vtino17
vtino17 force-pushed the fix/man-pages-windows branch from 9217262 to 84886e8 Compare July 24, 2026 08:48
adnanahamed66772ndpc pushed a commit to adnanahamed66772ndpc/cli that referenced this pull request Jul 25, 2026
os.system is a function object, comparing it to 'nt' always returns
False. Changed to sys.platform == 'win32' for correct Windows detection.

Closes httpie#1898, httpie#1903
@vtino17

vtino17 commented Aug 10, 2026

Copy link
Copy Markdown
Author

I pushed a focused regression test in commit 3a545d2. It verifies that Windows returns false before attempting to invoke man, while the implementation now uses sys.platform == "win32". The isolated Python regression check passes; CI is the cross-platform authority.

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