diff options
| author | Serhiy Storchaka <storchaka@gmail.com> | 2014-05-23 16:15:06 +0300 |
|---|---|---|
| committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-05-23 16:15:06 +0300 |
| commit | c083537b8731c8f2ffe607a12f96a3eb95f788f7 (patch) | |
| tree | c1687e6f23de98a1f0b8787a89af8516a9b5e60c /Lib/test | |
| parent | a7834d31c7cec6948f56d5f0b9c9a5ff29b5d05e (diff) | |
| parent | 065266450ea5519a43bcc199e48d304f1e7038e8 (diff) | |
| download | cpython-git-c083537b8731c8f2ffe607a12f96a3eb95f788f7.tar.gz | |
Issue #21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
Diffstat (limited to 'Lib/test')
| -rw-r--r-- | Lib/test/test_plistlib.py | 12 |
1 files changed, 12 insertions, 0 deletions
diff --git a/Lib/test/test_plistlib.py b/Lib/test/test_plistlib.py index bb7cc159b4..dc2fdf696d 100644 --- a/Lib/test/test_plistlib.py +++ b/Lib/test/test_plistlib.py @@ -411,6 +411,18 @@ class TestPlistlib(unittest.TestCase): pl2 = plistlib.loads(data) self.assertEqual(dict(pl), dict(pl2)) + def test_nonstandard_refs_size(self): + # Issue #21538: Refs and offsets are 24-bit integers + data = (b'bplist00' + b'\xd1\x00\x00\x01\x00\x00\x02QaQb' + b'\x00\x00\x08\x00\x00\x0f\x00\x00\x11' + b'\x00\x00\x00\x00\x00\x00' + b'\x03\x03' + b'\x00\x00\x00\x00\x00\x00\x00\x03' + b'\x00\x00\x00\x00\x00\x00\x00\x00' + b'\x00\x00\x00\x00\x00\x00\x00\x13') + self.assertEqual(plistlib.loads(data), {'a': 'b'}) + class TestPlistlibDeprecated(unittest.TestCase): def test_io_deprecated(self): |
