[New-bugs-announce] [issue13600] rot_13 codec not working

Ram Rachum report at bugs.python.org
Wed Dec 14 09:56:36 CET 2011


New submission from Ram Rachum <ram at rachum.com>:

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 "<pyshell#1>", line 1, in <module>
    'qwerty'.encode('rot_13')
TypeError: encoder did not return a bytes object (type=str)

>>> b'qwerty'.decode('utf-8')
'qwerty'
>>> b'qwerty'.decode('rot_13')
Traceback (most recent call last):
  File "<pyshell#2>", line 1, in <module>
    b'qwerty'.decode('rot_13')
  File "C:\Python32\lib\encodings\rot_13.py", line 19, in decode
    return (input.translate(rot13_map), len(input))
AttributeError: 'memoryview' object has no attribute 'translate'

----------
components: Library (Lib)
messages: 149431
nosy: cool-RR
priority: normal
severity: normal
status: open
title: rot_13 codec not working
versions: Python 3.3

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


More information about the New-bugs-announce mailing list