mirror of
https://github.com/python/cpython.git
synced 2025-11-20 02:50:14 +00:00
Issue #21538: The plistlib module now supports loading of binary plist files
when reference or offset size is not a power of two.
This commit is contained in:
parent
f01fffedd1
commit
065266450e
3 changed files with 28 additions and 6 deletions
|
|
@ -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):
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue