mirror of
https://github.com/python/cpython.git
synced 2025-11-03 03:22:27 +00:00
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.
This commit is contained in:
parent
e307e5cd06
commit
c981ad16b0
7 changed files with 169 additions and 5 deletions
|
|
@ -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:
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue