self._write_size(0x50, len(value))
except UnicodeEncodeError:
t = value.encode('utf-16be')
- self._write_size(0x60, len(value))
+ self._write_size(0x60, len(t) // 2)
self._fp.write(t)
plistlib.dumps,
testString)
+ def test_non_bmp_characters(self):
+ pl = {'python': '\U0001f40d'}
+ for fmt in ALL_FORMATS:
+ with self.subTest(fmt=fmt):
+ data = plistlib.dumps(pl, fmt=fmt)
+ self.assertEqual(plistlib.loads(data), pl)
+
def test_nondictroot(self):
for fmt in ALL_FORMATS:
with self.subTest(fmt=fmt):
Library
-------
+- Issue #28321: Fixed writing non-BMP characters with binary format in plistlib.
+
- Issue #28322: Fixed possible crashes when unpickle itertools objects from
incorrect pickle data. Based on patch by John Leitch.