Skip to content

Commit a55c3b1

Browse files
committed
errors="ignore" chicanery decode
1 parent 0f9bb1b commit a55c3b1

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

Lib/test/test_traceback_timestamps.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -218,14 +218,14 @@ def test_strip_exc_timestamps_function(self):
218218
"-X", f"traceback_timestamps={mode}",
219219
self.script_strip_path
220220
)
221-
output = result.out.decode() + result.err.decode(errors='replace')
221+
output = result.out.decode() + result.err.decode(errors='ignore')
222222

223223
# call strip_exc_timestamps in a process using the same mode as what generated our output.
224224
result = script_helper.assert_python_ok(
225225
"-X", f"traceback_timestamps={mode}",
226226
self.script_strip_path, output
227227
)
228-
stripped_output = result.out.decode() + result.err.decode(errors='replace')
228+
stripped_output = result.out.decode() + result.err.decode(errors='ignore')
229229

230230
# Verify original strings have timestamps and stripped ones don't
231231
self.assertIn("ZeroDivisionError: division by zero <@", output)
@@ -240,13 +240,13 @@ def test_strip_exc_timestamps_with_disabled_timestamps(self):
240240
result = script_helper.assert_python_failure(
241241
"-X", "traceback_timestamps=0", self.script_strip_path
242242
)
243-
output = result.out.decode() + result.err.decode(errors='replace')
243+
output = result.out.decode() + result.err.decode(errors='ignore')
244244

245245
# call strip_exc_timestamps in a process using the same mode as what generated our output.
246246
result = script_helper.assert_python_ok(
247247
"-X", "traceback_timestamps=0", self.script_strip_path, output
248248
)
249-
stripped_output = result.out.decode() + result.err.decode(errors='replace')
249+
stripped_output = result.out.decode() + result.err.decode(errors='ignore')
250250

251251
# All strings should be unchanged by the strip function
252252
self.assertIn("ZeroDivisionError: division by zero\n", stripped_output)

0 commit comments

Comments
 (0)