Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,10 @@
This document records all notable changes to [HTTPie](https://httpie.io).
This project adheres to [Semantic Versioning](https://semver.org/).

## [Unreleased]

- Fixed the Windows man-page availability check, which compared `os.system` (a function) to `'nt'` instead of `os.name`. ([#1898](https://github.com/httpie/cli/issues/1898))

## [3.2.4](https://github.com/httpie/cli/compare/3.2.3...3.2.4) (2024-11-01)

- Fix default certs loading and unpin `requests`. ([#1596](https://github.com/httpie/cli/issues/1596))
Expand Down
2 changes: 1 addition & 1 deletion httpie/output/ui/man_pages.py
Original file line number Diff line number Diff line change
Expand Up @@ -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(
Expand Down
9 changes: 9 additions & 0 deletions tests/test_windows.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,15 @@ def test_windows_colorized_output(self, httpbin):
http(httpbin + '/get', env=Environment())


def test_is_available_false_on_windows(monkeypatch):
# Regression: os.system == 'nt' is always False (os.system is a function).
from httpie.output.ui import man_pages

monkeypatch.setattr(man_pages.os, 'name', 'nt')
monkeypatch.setattr(man_pages, 'NO_MAN_PAGES', False)
assert man_pages.is_available('http') is False


class TestFakeWindows:
def test_output_file_pretty_not_allowed_on_windows(self, tmp_path, httpbin):
env = MockEnvironment(is_windows=True)
Expand Down
Loading