Skip to content

Commit b3c9006

Browse files
bigfootjonlisroach
authored andcommitted
bpo-36409: Remove old plistlib API deprecated in 3.4 (pythonGH-15615)
* Remove implementation for old plistlib API deprecated in 3.4
1 parent a506220 commit b3c9006

File tree

5 files changed

+31
-324
lines changed

5 files changed

+31
-324
lines changed

Doc/library/plistlib.rst

Lines changed: 6 additions & 76 deletions
Original file line numberDiff line numberDiff line change
@@ -30,7 +30,7 @@ To work with plist data in bytes objects, use :func:`dumps`
3030
and :func:`loads`.
3131

3232
Values can be strings, integers, floats, booleans, tuples, lists, dictionaries
33-
(but only with string keys), :class:`Data`, :class:`bytes`, :class:`bytesarray`
33+
(but only with string keys), :class:`bytes`, :class:`bytearray`
3434
or :class:`datetime.datetime` objects.
3535

3636
.. versionchanged:: 3.4
@@ -40,6 +40,9 @@ or :class:`datetime.datetime` objects.
4040
Support added for reading and writing :class:`UID` tokens in binary plists as used
4141
by NSKeyedArchiver and NSKeyedUnarchiver.
4242

43+
.. versionchanged:: 3.9
44+
Old API removed.
45+
4346
.. seealso::
4447

4548
`PList manual page <https://developer.apple.com/library/content/documentation/Cocoa/Conceptual/PropertyLists/>`_
@@ -48,7 +51,7 @@ or :class:`datetime.datetime` objects.
4851

4952
This module defines the following functions:
5053

51-
.. function:: load(fp, \*, fmt=None, use_builtin_types=True, dict_type=dict)
54+
.. function:: load(fp, \*, fmt=None, dict_type=dict)
5255

5356
Read a plist file. *fp* should be a readable and binary file object.
5457
Return the unpacked root object (which usually is a
@@ -62,10 +65,6 @@ This module defines the following functions:
6265

6366
* :data:`FMT_BINARY`: Binary plist format
6467

65-
If *use_builtin_types* is true (the default) binary data will be returned
66-
as instances of :class:`bytes`, otherwise it is returned as instances of
67-
:class:`Data`.
68-
6968
The *dict_type* is the type used for dictionaries that are read from the
7069
plist file.
7170

@@ -80,7 +79,7 @@ This module defines the following functions:
8079
.. versionadded:: 3.4
8180

8281

83-
.. function:: loads(data, \*, fmt=None, use_builtin_types=True, dict_type=dict)
82+
.. function:: loads(data, \*, fmt=None, dict_type=dict)
8483

8584
Load a plist from a bytes object. See :func:`load` for an explanation of
8685
the keyword arguments.
@@ -124,75 +123,6 @@ This module defines the following functions:
124123

125124
.. versionadded:: 3.4
126125

127-
The following functions are deprecated:
128-
129-
.. function:: readPlist(pathOrFile)
130-
131-
Read a plist file. *pathOrFile* may be either a file name or a (readable
132-
and binary) file object. Returns the unpacked root object (which usually
133-
is a dictionary).
134-
135-
This function calls :func:`load` to do the actual work, see the documentation
136-
of :func:`that function <load>` for an explanation of the keyword arguments.
137-
138-
.. deprecated:: 3.4 Use :func:`load` instead.
139-
140-
.. versionchanged:: 3.7
141-
Dict values in the result are now normal dicts. You no longer can use
142-
attribute access to access items of these dictionaries.
143-
144-
145-
.. function:: writePlist(rootObject, pathOrFile)
146-
147-
Write *rootObject* to an XML plist file. *pathOrFile* may be either a file name
148-
or a (writable and binary) file object
149-
150-
.. deprecated:: 3.4 Use :func:`dump` instead.
151-
152-
153-
.. function:: readPlistFromBytes(data)
154-
155-
Read a plist data from a bytes object. Return the root object.
156-
157-
See :func:`load` for a description of the keyword arguments.
158-
159-
.. deprecated:: 3.4 Use :func:`loads` instead.
160-
161-
.. versionchanged:: 3.7
162-
Dict values in the result are now normal dicts. You no longer can use
163-
attribute access to access items of these dictionaries.
164-
165-
166-
.. function:: writePlistToBytes(rootObject)
167-
168-
Return *rootObject* as an XML plist-formatted bytes object.
169-
170-
.. deprecated:: 3.4 Use :func:`dumps` instead.
171-
172-
173-
The following classes are available:
174-
175-
.. class:: Data(data)
176-
177-
Return a "data" wrapper object around the bytes object *data*. This is used
178-
in functions converting from/to plists to represent the ``<data>`` type
179-
available in plists.
180-
181-
It has one attribute, :attr:`data`, that can be used to retrieve the Python
182-
bytes object stored in it.
183-
184-
.. deprecated:: 3.4 Use a :class:`bytes` object instead.
185-
186-
.. class:: UID(data)
187-
188-
Wraps an :class:`int`. This is used when reading or writing NSKeyedArchiver
189-
encoded data, which contains UID (see PList manual).
190-
191-
It has one attribute, :attr:`data` which can be used to retrieve the int value
192-
of the UID. :attr:`data` must be in the range `0 <= data <= 2**64`.
193-
194-
.. versionadded:: 3.8
195-
196126

197127
The following constants are available:
198128

Doc/whatsnew/3.9.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ Removed
213213
instead. The ``xml.etree.cElementTree`` module has been removed.
214214
(Contributed by Serhiy Storchaka in :issue:`36543`.)
215215

216+
* The old :mod:`plistlib` API has been removed, it was deprecated since Python
217+
3.4. Use the :func:`load`, :func:`loads`, :func:`dump`, and :func:`dumps`
218+
functions. Additionally, the ``use_builtin_types`` parameter was removed,
219+
standard :class:`bytes` objects are always used.
220+
(Contributed by Jon Janzen in :issue:`36409`.)
221+
216222

217223
Porting to Python 3.9
218224
=====================

0 commit comments

Comments
 (0)