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.htmlGH-plistlib.load
https://docs.python.org/3/library/plistlib.htmlGH-plistlib.dump
(cherry picked from commit
0d4f4352efecf1b044c88e234e71774fe04b7d6c)
Co-authored-by: Collin Styles <collingstyles@gmail.com>
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:
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,))