Skip to content

Fix subprocess stream decoding for split UTF-8 output - #1074

Open
0xTaoZ wants to merge 1 commit into
pypa:mainfrom
0xTaoZ:0xTaoZ/fix-subprocess-stream-decoding
Open

Fix subprocess stream decoding for split UTF-8 output#1074
0xTaoZ wants to merge 1 commit into
pypa:mainfrom
0xTaoZ:0xTaoZ/fix-subprocess-stream-decoding

Conversation

@0xTaoZ

@0xTaoZ 0xTaoZ commented Jul 2, 2026

Copy link
Copy Markdown

Fixes #574.

This updates the subprocess wrapper to drain stdout and stderr concurrently while decoding progress stdout with an incremental UTF-8 decoder. That prevents split multibyte sequences from being surfaced as replacement characters while preserving the existing progress update behavior.

Tests added:

  • split multibyte stdout with log_stdout=True
  • split multibyte stderr on subprocess failure

Local checks:

  • .venv/bin/python -m pytest test/test_subprocess.py -q
  • .venv/bin/python -m ruff check pip_audit/_subprocess.py test/test_subprocess.py
  • .venv/bin/python -m mypy pip_audit/_subprocess.py
  • .venv/bin/python -m ruff format --check pip_audit/_subprocess.py test/test_subprocess.py
  • git diff --check

@0xTaoZ
0xTaoZ force-pushed the 0xTaoZ/fix-subprocess-stream-decoding branch from 58ed4d7 to e689b73 Compare July 2, 2026 12:40
@0xTaoZ
0xTaoZ marked this pull request as ready for review July 2, 2026 12:40
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.

Subprocess: fix stream handling

1 participant