Branch: refs/heads/main
Home: https://github.com/WebKit/WebKit
Commit: 3d5b2ebc628068d224d40e5ee8a205dc8a9c3f62
https://github.com/WebKit/WebKit/commit/3d5b2ebc628068d224d40e5ee8a205dc8a9c3f62
Author: Alicia Boya Garcia <[email protected]>
Date: 2025-05-19 (Mon, 19 May 2025)
Changed paths:
M Tools/Scripts/webkitpy/port/driver.py
Log Message:
-----------
[WTR] Replace invalid UTF-8 bytes instead of crashing
https://bugs.webkit.org/show_bug.cgi?id=292925
Reviewed by Patrick Griffis.
Currently, if invalid UTF-8 is printed to stderr, the test runner
crashes with an error like this:
UnicodeDecodeError raised: 'utf-8' codec can't decode byte 0xd6 in
position 179: invalid continuation byte
This is particularly a problem when running tests with environment
variables used by various libraries for debugging, as any improper
encoding will not only crash, but leave you with very few cues of what
caused it.
This patch makes the test runner code that reads stderr use
errors="replace" when decoding UTF-8: any invalid UTF-8 sequences will
be replaced by U+FFFD � REPLACEMENT CHARACTER.
This allows users to continue debugging in the presence of invalid UTF-8
in stderr logs. Any invalid UTF-8 sequences can still be found by
searching for the replacement character.
The specific invalid sequence is lost. Personally, I would prefer if
stderr was collected as a bytestring so that the -stderr.txt file
contained byte-by-byte match of what the test runner emitted, but the
refactor necessary to be able to accomplish that is outside of the scope
of this patch.
* Tools/Scripts/webkitpy/port/driver.py:
(Driver._read_block):
Canonical link: https://commits.webkit.org/295135@main
To unsubscribe from these emails, change your notification settings at
https://github.com/WebKit/WebKit/settings/notifications
_______________________________________________
webkit-changes mailing list
[email protected]
https://lists.webkit.org/mailman/listinfo/webkit-changes