From 5f2a1bc4c905adcb157a3e20d01b74645d6347c6 Mon Sep 17 00:00:00 2001 From: Zo Bot Date: Wed, 17 Jun 2026 07:38:40 +0000 Subject: [PATCH] fix Windows short-circuit in man_pages.is_available is_available guarded against Windows with `os.system == 'nt'`. os.system is the built-in function object from the os module, never a string, so the comparison was always False and the function never short-circuited on Windows even though that was clearly the author's intent (the surrounding code is checking whether the running OS has the `man` binary). On Windows the function fell through to `subprocess.run([MAN_COMMAND, ...])`, which is missing from PATH and raised FileNotFoundError that was then swallowed by the bare `except Exception`, so users saw a confusing 'no man pages found' instead of an immediate 'not on Windows' early return. --- httpie/output/ui/man_pages.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/httpie/output/ui/man_pages.py b/httpie/output/ui/man_pages.py index 0ba4974578..589b928553 100644 --- a/httpie/output/ui/man_pages.py +++ b/httpie/output/ui/man_pages.py @@ -18,7 +18,7 @@ def is_available(program: str) -> bool: Check whether `program`'s man pages are available on this system. """ - if NO_MAN_PAGES or os.system == 'nt': + if NO_MAN_PAGES or os.name == 'nt': return False try: process = subprocess.run(