[New-bugs-announce] [issue6213] Incremental encoder incompatibility between 2.x and py3k

Antoine Pitrou report at bugs.python.org
Fri Jun 5 22:17:43 CEST 2009


New submission from Antoine Pitrou <pitrou at free.fr>:

The behaviour of several incremental encoders is inconsistent between
2.x and py3k.

In 2.x:
>>> enc = codecs.getincrementalencoder('utf-16')()
>>> enc.getstate()
0
>>> enc.setstate(0)
>>> enc.encode(u'abc')
'\xff\xfea\x00b\x00c\x00'

In py3k:
>>> enc = codecs.getincrementalencoder('utf-16')()
>>> enc.getstate()
2
>>> enc.setstate(0)
>>> enc.encode('abc')
b'a\x00b\x00c\x00'

----------
messages: 88972
nosy: pitrou
priority: normal
severity: normal
status: open
title: Incremental encoder incompatibility between 2.x and py3k
type: behavior
versions: Python 2.7, Python 3.2

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue6213>
_______________________________________


More information about the New-bugs-announce mailing list