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

- Fix `--quiet` (and `-qq`) not suppressing warnings/errors when stdout is redirected. ([#1978](https://github.com/httpie/httpie/issues/1978))

## [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/context.py
Original file line number Diff line number Diff line change
Expand Up @@ -168,7 +168,7 @@ def as_silent(self) -> Iterator[None]:
self.stderr = original_stderr

def log_error(self, msg: str, level: LogLevel = LogLevel.ERROR) -> None:
if self.stdout_isatty and self.quiet >= LOG_LEVEL_DISPLAY_THRESHOLDS[level]:
if self.quiet >= LOG_LEVEL_DISPLAY_THRESHOLDS[level]:
stderr = self.stderr # Not directly /dev/null, since stderr might be mocked
else:
stderr = self._orig_stderr
Expand Down
4 changes: 3 additions & 1 deletion tests/test_output.py
Original file line number Diff line number Diff line change
Expand Up @@ -89,7 +89,9 @@ def test_quiet_quiet_with_check_status_non_zero_pipe(self, httpbin):
tolerate_error_exit_status=True,
env=MockEnvironment(stdout_isatty=False)
)
assert 'http: warning: HTTP 500' in r.stderr
# Warnings are suppressed with -qq regardless of whether stdout
# is a TTY, as documented ("Provide twice to suppress warnings as well").
assert not r.stderr

@mock.patch('httpie.core.program')
@pytest.mark.parametrize('flags, expected_warnings', [
Expand Down
Loading