Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 13 additions & 0 deletions Lib/codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -525,6 +525,19 @@ def read(self, size=-1, chars=-1, firstline=False):
self.charbuffer += newchars
# there was no data available
if not newdata:
# The stream is exhausted. If there are leftover bytes in
# bytebuffer, they form an incomplete character. Decode them
# now so that the error handler is applied (strict raises,
# replace emits the replacement character, ignore drops them).
if self.bytebuffer:
try:
newchars, decodedbytes = self.decode(
self.bytebuffer, self.errors, True)
except TypeError:
newchars, decodedbytes = self.decode(
self.bytebuffer, self.errors)
self.bytebuffer = self.bytebuffer[decodedbytes:]
self.charbuffer += newchars
break
if chars < 0:
# Return everything we've got
Expand Down
4 changes: 2 additions & 2 deletions Lib/encodings/raw_unicode_escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class StreamWriter(Codec,codecs.StreamWriter):
pass

class StreamReader(Codec,codecs.StreamReader):
def decode(self, input, errors='strict'):
return codecs.raw_unicode_escape_decode(input, errors, False)
def decode(self, input, errors='strict', final=False):
return codecs.raw_unicode_escape_decode(input, errors, final)

### encodings module API

Expand Down
4 changes: 2 additions & 2 deletions Lib/encodings/unicode_escape.py
Original file line number Diff line number Diff line change
Expand Up @@ -29,8 +29,8 @@ class StreamWriter(Codec,codecs.StreamWriter):
pass

class StreamReader(Codec,codecs.StreamReader):
def decode(self, input, errors='strict'):
return codecs.unicode_escape_decode(input, errors, False)
def decode(self, input, errors='strict', final=False):
return codecs.unicode_escape_decode(input, errors, final)

### encodings module API

Expand Down
4 changes: 2 additions & 2 deletions Lib/encodings/utf_16.py
Original file line number Diff line number Diff line change
Expand Up @@ -130,9 +130,9 @@ def reset(self):
except AttributeError:
pass

def decode(self, input, errors='strict'):
def decode(self, input, errors='strict', final=False):
(object, consumed, byteorder) = \
codecs.utf_16_ex_decode(input, errors, 0, False)
codecs.utf_16_ex_decode(input, errors, 0, final)
if byteorder == -1:
self.decode = codecs.utf_16_le_decode
elif byteorder == 1:
Expand Down
4 changes: 2 additions & 2 deletions Lib/encodings/utf_32.py
Original file line number Diff line number Diff line change
Expand Up @@ -125,9 +125,9 @@ def reset(self):
except AttributeError:
pass

def decode(self, input, errors='strict'):
def decode(self, input, errors='strict', final=False):
(object, consumed, byteorder) = \
codecs.utf_32_ex_decode(input, errors, 0, False)
codecs.utf_32_ex_decode(input, errors, 0, final)
if byteorder == -1:
self.decode = codecs.utf_32_le_decode
elif byteorder == 1:
Expand Down
9 changes: 6 additions & 3 deletions Lib/encodings/utf_8_sig.py
Original file line number Diff line number Diff line change
Expand Up @@ -102,19 +102,22 @@ def reset(self):
except AttributeError:
pass

def decode(self, input, errors='strict'):
def decode(self, input, errors='strict', final=False):
if len(input) < 3:
if codecs.BOM_UTF8.startswith(input):
if final:
self.decode = codecs.utf_8_decode
return codecs.utf_8_decode(input, errors, final)
# not enough data to decide if this is a BOM
# => try again on the next call
return ("", 0)
elif input[:3] == codecs.BOM_UTF8:
self.decode = codecs.utf_8_decode
(output, consumed) = codecs.utf_8_decode(input[3:],errors)
(output, consumed) = codecs.utf_8_decode(input[3:], errors, final)
return (output, consumed+3)
# (else) no BOM present
self.decode = codecs.utf_8_decode
return codecs.utf_8_decode(input, errors)
return codecs.utf_8_decode(input, errors, final)

### encodings module API

Expand Down
42 changes: 42 additions & 0 deletions Lib/test/test_codecs.py
Original file line number Diff line number Diff line change
Expand Up @@ -128,7 +128,7 @@
result = ""
for (c, partialresult) in zip(input.encode(self.encoding), partialresults, strict=True):
q.write(bytes([c]))
result += r.read()

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UnicodeEscapeTest.test_partial)

UnicodeDecodeError: 'unicodeescape' codec can't decode byte 0x5c in position 0: \ at end of string

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF8Test.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xc3 in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF8SigTest.test_partial)

UnicodeDecodeError: 'utf-8' codec can't decode byte 0xef in position 0: unexpected end of data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF32Test.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF32LETest.test_partial)

UnicodeDecodeError: 'utf-32-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF32BETest.test_partial)

UnicodeDecodeError: 'utf-32-be' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF16Test.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF16LETest.test_partial)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0x00 in position 0: truncated data

Check failure on line 131 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_partial (test.test_codecs.UTF16BETest.test_partial)

UnicodeDecodeError: 'utf-16-be' codec can't decode byte 0x00 in position 0: truncated data
self.assertEqual(result, partialresult)
# check that there's nothing left in the buffers
self.assertEqual(r.read(), "")
Expand Down Expand Up @@ -2103,6 +2103,48 @@
with self.assertRaisesRegex(TypeError, 'StreamReader'):
pickle.dumps(f, proto)

def test_incomplete_final_character_strict(self):
# gh-160309: An incomplete character at end of stream must raise
# UnicodeDecodeError in strict mode rather than being silently dropped.
for encoding in ('utf-8', 'utf-16', 'utf-16-le', 'utf-32', 'utf-32-le', 'utf-8-sig'):
with self.subTest(encoding=encoding):
data = b'\xe2\x82' if 'utf-8' in encoding else b'a\x00\xe2'
reader = codecs.getreader(encoding)(io.BytesIO(data), errors='strict')
with self.assertRaises(UnicodeDecodeError):
reader.read()

def test_incomplete_final_character_replace(self):
# gh-160309: In replace mode, an incomplete final character must produce
# the replacement character.
reader = codecs.getreader('utf-8')(io.BytesIO(b'abc\xe2\x82'), errors='replace')
self.assertEqual(reader.read(), 'abc\ufffd')

# Chunked reading (size > 0)
reader = codecs.getreader('utf-8')(io.BytesIO(b'abc\xe2\x82'), errors='replace')
chunks = []
while True:
c = reader.read(2)
if not c:
break
chunks.append(c)
self.assertEqual(''.join(chunks), 'abc\ufffd')

def test_incomplete_final_character_ignore(self):
# gh-160309: In ignore mode, the incomplete final bytes are dropped.
reader = codecs.getreader('utf-8')(io.BytesIO(b'abc\xe2\x82'), errors='ignore')
self.assertEqual(reader.read(), 'abc')
self.assertEqual(reader.bytebuffer, b'')

def test_custom_two_arg_streamreader_subclass(self):
# Custom StreamReader subclasses whose decode() method only accepts
# 2 arguments (input, errors='strict') should continue to work.
class CustomReader(codecs.StreamReader):
def decode(self, input, errors='strict'):
return input.decode('latin1', errors), len(input)

reader = CustomReader(io.BytesIO(b'hello'))
self.assertEqual(reader.read(), 'hello')


class StreamWriterTest(unittest.TestCase):

Expand Down Expand Up @@ -2332,7 +2374,7 @@
decodedresult += decoder.decode(b"", True)
self.assertEqual(decodedresult, s,
"encoding=%r" % encoding)

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (installed) / build, install and test

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (bolt) / build and test (ubuntu-26.04)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, tail-call)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Lazy imports enabled / Run Tests with lazy_imports=all

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04-arm)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Hypothesis tests on Ubuntu

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu / build and test (ubuntu-26.04-arm)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, tail-call)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, tail-call)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / MSan

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Emscripten / build and test

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, tail-call)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS / build and test (macos-26-intel)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / ASan

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Ubuntu (free-threading) / build and test (ubuntu-26.04)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Sanitizers / UBSan

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / macOS (free-threading) / build and test (macos-26)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (arm64, switch-case)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (x64, switch-case)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (Win32, switch-case)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows / Build and test (x64, switch-case)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data

Check failure on line 2377 in Lib/test/test_codecs.py

View workflow job for this annotation

GitHub Actions / Windows (free-threading) / Build and test (arm64, switch-case)

test_basics (test.test_codecs.BasicUnicodeTest.test_basics)

UnicodeDecodeError: 'utf-16-le' codec can't decode byte 0xff in position 0: truncated data
# check iterencode()/iterdecode()
result = "".join(codecs.iterdecode(
codecs.iterencode(s, encoding), encoding))
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
Fix codecs.StreamReader.read() silently dropping an incomplete character at the end of the stream.
Loading