[issue13600] rot_13 codec not working

2011-12-14 Thread Petri Lehtinen
Petri Lehtinen added the comment: Issue #7475 discusses fixing the error messages, too. -- components: +Library (Lib) resolution: -> duplicate stage: committed/rejected -> status: open -> closed superseder: -> codecs missing: base64 bz2 hex zlib hex_codec ... ___

[issue13600] rot_13 codec not working

2011-12-14 Thread Ram Rachum
Ram Rachum added the comment: Then I suggest replacing this error message: encoder did not return a bytes object (type=str) and this one: 'memoryview' object has no attribute 'translate' With something like: Please use `codecs.lookup('rot-13').encode` -- assignee: -> d

[issue13600] rot_13 codec not working

2011-12-14 Thread Petri Lehtinen
Petri Lehtinen added the comment: Ram Rachum wrote: > The `rot_13` codec is supposed to work like this, no? No it isn't. In Python 3, str.encode() always encodes to bytes and bytes.decode() always decodes to str. IOW, str.encode() encodes text (Unicode) to data (bytes), and bytes.decode() dec

[issue13600] rot_13 codec not working

2011-12-14 Thread Ezio Melotti
Ezio Melotti added the comment: See #7475. -- nosy: +ezio.melotti ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscrib

[issue13600] rot_13 codec not working

2011-12-14 Thread Ram Rachum
New submission from Ram Rachum : The `rot_13` codec is supposed to work like this, no? >>> 'qwerty'.encode('utf-8') b'qwerty' >>> 'qwerty'.encode('rot_13') Traceback (most recent call last): File "", line 1, in 'qwerty'.encode('rot_13') TypeError: encoder did not return a bytes object (ty