This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author vstinner
Recipients Marcus.Gröber, ezio.melotti, lovelylain, serhiy.storchaka, vstinner
Date 2012-10-09.21:11:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1349817107.41.0.67874158048.issue15278@psf.upfronthosting.co.za>
In-reply-to
Content
This issue may be related or a duplicate of #11461.

> For example codecs.utf_16_le_decode(b'\x00\xd8\x00') should return ('', 0), but raises UnicodeDecodeError.

Only incremental decoder should return partial results. Other decoders are strict and (usually) stateless.

$ ./python 
>>> import codecs
>>> decoder = codecs.getdecoder('utf8')
>>> decoder('\u20ac'.encode('utf8'), 'strict')
('€', 3)
>>> decoder('\u20ac'.encode('utf8')[:2], 'strict')
UnicodeDecodeError: 'utf-8' codec can't decode bytes in position 0-1: unexpected end of data
History
Date User Action Args
2012-10-09 21:11:47vstinnersetrecipients: + vstinner, ezio.melotti, serhiy.storchaka, lovelylain, Marcus.Gröber
2012-10-09 21:11:47vstinnersetmessageid: <1349817107.41.0.67874158048.issue15278@psf.upfronthosting.co.za>
2012-10-09 21:11:47vstinnerlinkissue15278 messages
2012-10-09 21:11:47vstinnercreate