← Back to issue list

fix: handle errors when decoding bytes from subprocesses

View original Github issue

Metadata

Project
craft-cli
Number
#222
Type
pull request
State
merged
Author
tigarmo
Labels
—
Created
Updated
Closed

Current evaluation

PR #222 merged as commit 9e017d4: craft_cli/messages.py now decodes subprocess pipe bytes with errors="replace", substituting U+FFFD for invalid UTF-8. Closes issue #221.

Resolution: closed resolved

Reason: Merged into main as commit 9e017d4 ("fix: handle errors when decoding bytes from subprocesses (#222)"). The _PipeReaderThread now decodes with errors="replace" instead of raising on invalid UTF-8, fixing issue #221, which was closed; the maintainer confirmed the behaviour manually in Snapcraft.

Evaluated by: mr-cal-bot

No scores available.

Issue body

Since these bytes come from the output of unknown processes, there is no guarantee that they are valid utf-8 text. We also have no way to know what encoding they have (if any), so the best we can do is replace the invalid bytes with the usual unicode marker for that. Fixes #221 - [ ] Have you followed the guidelines for contributing? - [ ] Have you signed the [CLA](http://www.ubuntu.com/legal/contributors/)? - [ ] Have you successfully run `tox`?

Evaluation history

Date Model Scores Action Summary
stealth/space-bunny-alpha — closed resolved PR #222 merged as commit 9e017d4: craft_cli/messages.py now decodes subprocess pipe bytes with errors="replace", substituting U+FFFD for invalid UTF-8. Closes issue #221.
stealth/space-bunny-alpha — closed resolved Merged PR #222 as commit 9e017d4, replacing invalid subprocess-output bytes with U+FFFD and fixing #221.
qwen/qwen3.6-35b-a3b — — Merged to address subprocess byte decoding failures. Invalid UTF-8 sequences are now safely replaced with the Unicode replacement character. Approved by two reviewers, passed CI checks, and verified in Snapcraft. Resolves #221.

Update history

No update history recorded yet.

Related work

  • Likely Fixed By: canonical/craft-cli#221 (confidence 98%)

    The bug issue explicitly fixed by PR #222 (non-utf8 text crashing _PipeReaderThread).

  • Related To: canonical/craft-cli#223 (confidence 30%)

    No confirmed link; listed only as the adjacent issue number, not verified.

Related issues

No related issues found above the similarity threshold.