summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorCollin Styles <collingstyles@gmail.com>2019-07-14 02:01:48 -0700
committerRonald Oussoren <ronaldoussoren@mac.com>2019-07-14 11:01:48 +0200
commit0d4f4352efecf1b044c88e234e71774fe04b7d6c (patch)
treec6c0eabd42bf83ed63a0e91172682033ec0d2267
parent52c8c090870c4e45dc48d1991d7ef7de2e40b2a8 (diff)
downloadcpython-git-0d4f4352efecf1b044c88e234e71774fe04b7d6c.tar.gz
Clarify that plistlib's load and dump functions take a binary file object (GH-9825)
The documentation says that the fp parameter to plistlib.load "should be a readable and binary file object" but the docstring only mentions that it should be readable. Similarly, plistlib.dump's docstring only mentions "writable". This commit clarifies that fp should also be binary. https://docs.python.org/3/library/plistlib.html#plistlib.load https://docs.python.org/3/library/plistlib.html#plistlib.dump
-rw-r--r--Lib/plistlib.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/plistlib.py b/Lib/plistlib.py
index 0133c89bdc..04f8a87634 100644
--- a/Lib/plistlib.py
+++ b/Lib/plistlib.py
@@ -971,7 +971,7 @@ _FORMATS={
def load(fp, *, fmt=None, use_builtin_types=True, dict_type=dict):
- """Read a .plist file. 'fp' should be (readable) file object.
+ """Read a .plist file. 'fp' should be a readable and binary file object.
Return the unpacked root object (which usually is a dictionary).
"""
if fmt is None:
@@ -1002,8 +1002,8 @@ def loads(value, *, fmt=None, use_builtin_types=True, dict_type=dict):
def dump(value, fp, *, fmt=FMT_XML, sort_keys=True, skipkeys=False):
- """Write 'value' to a .plist file. 'fp' should be a (writable)
- file object.
+ """Write 'value' to a .plist file. 'fp' should be a writable,
+ binary file object.
"""
if fmt not in _FORMATS:
raise ValueError("Unsupported format: %r"%(fmt,))