Skip to content

Fix echoing empty binary messages#3490

Closed
puneetdixit200 wants to merge 1 commit into
pallets:mainfrom
puneetdixit200:echo-empty-bytes-newline
Closed

Fix echoing empty binary messages#3490
puneetdixit200 wants to merge 1 commit into
pallets:mainfrom
puneetdixit200:echo-empty-bytes-newline

Conversation

@puneetdixit200
Copy link
Copy Markdown

Fixes #3487

Summary

  • preserve binary message types when adding a trailing newline in click.echo
  • cover empty bytes and bytearray output to default and binary streams

Tests

  • uv run --frozen python -m pytest tests/test_utils.py -k "echo" -q
  • uv run --frozen python -m pytest tests/test_utils.py -q
  • uv run --frozen python -m pytest -q
  • uv run --frozen ruff check src\click\utils.py tests\test_utils.py

@davidism davidism closed this May 21, 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.

Echoing empty bytes or bytearray raises TypeError

2 participants