-
-
Notifications
You must be signed in to change notification settings - Fork 528
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Avoid UnicodeDecodeError from command output (#2970)
* test_sync_write_decode_surrogate: utf-8 decode When SyncWrite decodes bytes as utf-8, it should replace unknown sequences with the unicode surrogate codepoint instead of crashing the program. Test case for #2969 * SyncWrite: decode with errors='surrogateescape' Avoid bubbling UnicodeDecodeError up from stream handling internals. Tox has no way of knowing that the bytestream emitted by a command will be valid utf-8, even if utf-8 is ostensibly the "correct" encoding for the stream. It's always possible for an arbitrary command to return non-utf-8 bytes, and this situation should not break tox. Fix #2969
- Loading branch information
Showing
3 changed files
with
10 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,3 @@ | ||
Instead of raising ``UnicodeDecodeError`` when command output includes non-utf-8 bytes, | ||
``tox`` will now use ``surrogateescape`` error handling to convert the unrecognized bytes | ||
to escape sequences according to :pep:`383` - by :user:`masenf`. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters