diff options
author | Serhiy Storchaka <storchaka@gmail.com> | 2014-05-23 13:13:33 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2014-05-23 13:13:33 (GMT) |
commit | 065266450ea5519a43bcc199e48d304f1e7038e8 (patch) | |
tree | b88904805e57b2a8ff92093e67c3684cebbf7ab2 /Lib/test/test_plistlib.py | |
parent | f01fffedd1e0ee29c4535e9b10e39c3654f159d7 (diff) | |
download | cpython-065266450ea5519a43bcc199e48d304f1e7038e8.zip cpython-065266450ea5519a43bcc199e48d304f1e7038e8.tar.gz cpython-065266450ea5519a43bcc199e48d304f1e7038e8.tar.bz2 |
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/test_plistlib.py')
-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 bb7cc15..dc2fdf6 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): |