Author serhiy.storchaka
Recipients kuglee, ronaldoussoren, serhiy.storchaka
Date 2016-10-01.06:33:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1475303595.44.0.223011792749.issue28321@psf.upfronthosting.co.za>
In-reply-to
Content
The simplest reproducer:

>>> import plistlib
>>> plistlib.loads(plistlib.dumps('\U0001f40d', fmt=plistlib.FMT_BINARY))
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python3.5/plistlib.py", line 1006, in loads
    fp, fmt=fmt, use_builtin_types=use_builtin_types, dict_type=dict_type)
  File "/usr/lib/python3.5/plistlib.py", line 997, in load
    return p.parse(fp)
  File "/usr/lib/python3.5/plistlib.py", line 623, in parse
    return self._read_object(self._object_offsets[top_object])
  File "/usr/lib/python3.5/plistlib.py", line 704, in _read_object
    return self._fp.read(s * 2).decode('utf-16be')
  File "/usr/lib/python3.5/encodings/utf_16_be.py", line 16, in decode
    return codecs.utf_16_be_decode(input, errors, True)
UnicodeDecodeError: 'utf-16-be' codec can't decode bytes in position 0-1: unexpected end of data

Proposed patch fixes this issue.
History
Date User Action Args
2016-10-01 06:33:15serhiy.storchakasetrecipients: + serhiy.storchaka, ronaldoussoren, kuglee
2016-10-01 06:33:15serhiy.storchakasetmessageid: <1475303595.44.0.223011792749.issue28321@psf.upfronthosting.co.za>
2016-10-01 06:33:15serhiy.storchakalinkissue28321 messages
2016-10-01 06:33:14serhiy.storchakacreate