Lines Matching refs:bytes

41     MAX_LEADBYTES = 12  # 5 ranges, 2 bytes ea., 0 term.
59 queue: write bytes at one end, read bytes from the other end
122 q.write(bytes([c]))
133 result += d.decode(bytes([c]))
143 result += d.decode(bytes([c]))
153 "".join(codecs.iterdecode([bytes([c]) for c in encoded], self.encoding))
944 other_ascii = ''.join(sorted(set(bytes(range(0x80)).decode()) -
1173 b = bytes([b])
1200 b = bytes([i])
1214 check(rb'\%o' % i, bytes([i & 0o377]))
1569 "".join(codecs.iterdecode((bytes([c]) for c in b"python.org"), "idna")),
1573 "".join(codecs.iterdecode((bytes([c]) for c in b"python.org."), "idna")),
1577 "".join(codecs.iterdecode((bytes([c]) for c in b"xn--pythn-mua.org."), "idna")),
1581 "".join(codecs.iterdecode((bytes([c]) for c in b"xn--pythn-mua.org."), "idna")),
1934 self.assertTrue(type(chunk) is bytes, type(chunk))
1940 q.write(bytes([c]))
1959 decodedresult += decoder.decode(bytes([c]))
1983 decodedresult = "".join(decoder.decode(bytes([c]))
2008 decodedresult += cdecoder.decode(bytes([c]))
2022 decodedresult = "".join(cdecoder.decode(bytes([c]))
2119 allbytes = bytes(range(256))
2223 allbytes = bytes(range(256))
2356 # result as decoding the equivalent ASCII bytes string.
2386 self.assertEqual(encode(chr(b)), (bytes([b]), 1))
2392 self.assertEqual(decode(bytes([b]) + b'0'), (chr(b) + '0', 2))
2434 b = bytes([i])
2518 self.assertEqual(encode(chr(b)), (bytes([b]), 1))
2523 self.assertEqual(decode(bytes([b]) + b'0'), (chr(b) + '0', 2))
2530 check('\\' + chr(b), b'\\' + bytes([b]))
2539 check(b'\\' + bytes([b]), '\\' + chr(b))
2734 binput = bytes(range(256))
2798 # Check bytes.decode and bytearray.decode give a good error
2925 b"bytes input".decode(self.codec_name)
2927 codecs.decode(b"bytes input", self.codec_name)
2957 b"bytes input".decode(self.codec_name)
2959 codecs.decode(b"bytes input", self.codec_name)
2995 b"bytes input".decode(self.codec_name)
2997 codecs.decode(b"bytes input", self.codec_name)
3006 return "not bytes!", 0
3012 self.assertEqual(encoded, "not bytes!")
3016 fmt = (r"^{!r} encoder returned 'str' instead of 'bytes'; "
3021 fmt = (r"^{!r} decoder returned 'bytes' instead of 'str'; "
3025 b"bytes input".decode(self.codec_name)
3102 # invalid bytes
3148 # invalid bytes
3220 # Input should contain undecodable bytes before and after