diff options
author | Xiang Zhang <angwerzx@126.com> | 2018-03-25 04:09:21 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2018-03-25 04:09:21 (GMT) |
commit | e4ce9fa89cb542dced553710b05de85202bc4715 (patch) | |
tree | d1bc2e48332ba57b268e2e3d875005b63f926f1f /Lib/encodings | |
parent | c42e7aa67ce72a6c4c6cdfe3b0929ca07556d444 (diff) | |
download | cpython-e4ce9fa89cb542dced553710b05de85202bc4715.zip cpython-e4ce9fa89cb542dced553710b05de85202bc4715.tar.gz cpython-e4ce9fa89cb542dced553710b05de85202bc4715.tar.bz2 |
bpo-32943: Fix confusing error message for rot13 codec (GH-5869)
Diffstat (limited to 'Lib/encodings')
-rwxr-xr-x | Lib/encodings/rot_13.py | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/Lib/encodings/rot_13.py b/Lib/encodings/rot_13.py index f0b4186..5627bfb 100755 --- a/Lib/encodings/rot_13.py +++ b/Lib/encodings/rot_13.py @@ -12,18 +12,18 @@ import codecs class Codec(codecs.Codec): def encode(self, input, errors='strict'): - return (input.translate(rot13_map), len(input)) + return (str.translate(input, rot13_map), len(input)) def decode(self, input, errors='strict'): - return (input.translate(rot13_map), len(input)) + return (str.translate(input, rot13_map), len(input)) class IncrementalEncoder(codecs.IncrementalEncoder): def encode(self, input, final=False): - return input.translate(rot13_map) + return str.translate(input, rot13_map) class IncrementalDecoder(codecs.IncrementalDecoder): def decode(self, input, final=False): - return input.translate(rot13_map) + return str.translate(input, rot13_map) class StreamWriter(Codec,codecs.StreamWriter): pass |