diff options
| author | Mark Dickinson <mdickinson@enthought.com> | 2021-08-23 14:24:12 (GMT) |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2021-08-23 14:24:12 (GMT) |
| commit | ae5259171b8ef62165e061b9dea7ad645a5131a2 (patch) | |
| tree | cfeedb7cd3d61e804813461486f3805819471358 /Lib/test/test_bytes.py | |
| parent | 24b63c695ae0a95b06379eaadace66735abac1e2 (diff) | |
| download | cpython-ae5259171b8ef62165e061b9dea7ad645a5131a2.zip cpython-ae5259171b8ef62165e061b9dea7ad645a5131a2.tar.gz cpython-ae5259171b8ef62165e061b9dea7ad645a5131a2.tar.bz2 | |
Fix bytes.__bytes__ to not truncate at a zero byte (GH-27902)
Diffstat (limited to 'Lib/test/test_bytes.py')
| -rw-r--r-- | Lib/test/test_bytes.py | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/test/test_bytes.py b/Lib/test/test_bytes.py index c45c69f..c2fe2cc 100644 --- a/Lib/test/test_bytes.py +++ b/Lib/test/test_bytes.py @@ -982,14 +982,14 @@ class BytesTest(BaseBytesTest, unittest.TestCase): type2test = bytes def test__bytes__(self): - foo = b'foo' + foo = b'foo\x00bar' self.assertEqual(foo.__bytes__(), foo) self.assertEqual(type(foo.__bytes__()), self.type2test) class bytes_subclass(bytes): pass - bar = bytes_subclass(b'bar') + bar = bytes_subclass(b'bar\x00foo') self.assertEqual(bar.__bytes__(), bar) self.assertEqual(type(bar.__bytes__()), self.type2test) |
