classification
Title: Saving bytearray to binary plist file doesn't work
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.7, Python 3.6
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: serhiy.storchaka Nosy List: ronaldoussoren, serhiy.storchaka
Priority: normal Keywords:

Created on 2017-11-08 23:20 by serhiy.storchaka, last changed 2017-11-10 09:56 by serhiy.storchaka.

Messages (1)
msg305921 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2017-11-08 23:20
>>> import plistlib
>>> plistlib.dumps(bytearray(), fmt=plistlib.FMT_BINARY)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/serhiy/py/cpython/Lib/plistlib.py", line 962, in dumps
    dump(value, fp, fmt=fmt, skipkeys=skipkeys, sort_keys=sort_keys)
  File "/home/serhiy/py/cpython/Lib/plistlib.py", line 955, in dump
    writer.write(value)
  File "/home/serhiy/py/cpython/Lib/plistlib.py", line 703, in write
    self._flatten(value)
  File "/home/serhiy/py/cpython/Lib/plistlib.py", line 741, in _flatten
    if (type(value), value) in self._objtable:
TypeError: unhashable type: 'bytearray'
History
Date User Action Args
2017-11-10 09:56:10serhiy.storchakasetassignee: serhiy.storchaka
2017-11-08 23:20:21serhiy.storchakacreate