diff options
author | Jon Janzen <jjjonjanzen@gmail.com> | 2019-05-15 20:14:38 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2019-05-15 20:14:38 (GMT) |
commit | c981ad16b0f9740bd3381c96b4227a1faa1a88d9 (patch) | |
tree | 11ae5ac3f709d5ddd54a27334207441f7debe025 /Doc | |
parent | e307e5cd06f60e11e4e4f126fae412b9ec66a005 (diff) | |
download | cpython-c981ad16b0f9740bd3381c96b4227a1faa1a88d9.zip cpython-c981ad16b0f9740bd3381c96b4227a1faa1a88d9.tar.gz cpython-c981ad16b0f9740bd3381c96b4227a1faa1a88d9.tar.bz2 |
bpo-26707: Enable plistlib to read UID keys. (GH-12153)
Plistlib currently throws an exception when asked to decode a valid
.plist file that was generated by Apple's NSKeyedArchiver. Specifically,
this is caused by a byte 0x80 (signifying a UID) not being understood.
This fixes the problem by enabling the binary plist reader and writer
to read and write plistlib.UID objects.
Diffstat (limited to 'Doc')
-rw-r--r-- | Doc/library/plistlib.rst | 14 | ||||
-rw-r--r-- | Doc/whatsnew/3.8.rst | 8 |
2 files changed, 22 insertions, 0 deletions
diff --git a/Doc/library/plistlib.rst b/Doc/library/plistlib.rst index 8bd6b63..d84fcac 100644 --- a/Doc/library/plistlib.rst +++ b/Doc/library/plistlib.rst @@ -36,6 +36,10 @@ or :class:`datetime.datetime` objects. .. versionchanged:: 3.4 New API, old API deprecated. Support for binary format plists added. +.. versionchanged:: 3.8 + Support added for reading and writing :class:`UID` tokens in binary plists as used + by NSKeyedArchiver and NSKeyedUnarchiver. + .. seealso:: `PList manual page <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/>`_ @@ -179,6 +183,16 @@ The following classes are available: .. deprecated:: 3.4 Use a :class:`bytes` object instead. +.. class:: UID(data) + + Wraps an :class:`int`. This is used when reading or writing NSKeyedArchiver + encoded data, which contains UID (see PList manual). + + It has one attribute, :attr:`data` which can be used to retrieve the int value + of the UID. :attr:`data` must be in the range `0 <= data <= 2**64`. + + .. versionadded:: 3.8 + The following constants are available: diff --git a/Doc/whatsnew/3.8.rst b/Doc/whatsnew/3.8.rst index a2af201..c135183 100644 --- a/Doc/whatsnew/3.8.rst +++ b/Doc/whatsnew/3.8.rst @@ -394,6 +394,14 @@ to a path. (Contributed by Joannah Nanjekye in :issue:`26978`) +plistlib +-------- + +Added new :class:`plistlib.UID` and enabled support for reading and writing +NSKeyedArchiver-encoded binary plists. +(Contributed by Jon Janzen in :issue:`26707`.) + + socket ------ |