]> granicus.if.org Git - python/commitdiff
Issue #21171: Fixed undocumented filter API of the rot13 codec.
authorSerhiy Storchaka <storchaka@gmail.com>
Sun, 13 Apr 2014 14:07:04 +0000 (17:07 +0300)
committerSerhiy Storchaka <storchaka@gmail.com>
Sun, 13 Apr 2014 14:07:04 +0000 (17:07 +0300)
Patch by Berker Peksag.

Lib/encodings/rot_13.py
Misc/NEWS

index 1f2f47bb34f32b7ab5c42e45bf8df34cdabac68e..f0b4186dc877a71891c96b52603c115d3cc68dee 100755 (executable)
@@ -106,7 +106,7 @@ rot13_map.update({
 ### Filter API
 
 def rot13(infile, outfile):
-    outfile.write(infile.read().encode('rot-13'))
+    outfile.write(codecs.encode(infile.read(), 'rot-13'))
 
 if __name__ == '__main__':
     import sys
index d4c06965e9a264ff8ea92ce49f405de395902730..f381c93109b01ca46432c10664b9de7fced5d1d5 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -27,6 +27,9 @@ Core and Builtins
 Library
 -------
 
+- Issue #21171: Fixed undocumented filter API of the rot13 codec.
+  Patch by Berker Peksag.
+
 - Issue #21172: isinstance check relaxed from dict to collections.Mapping.
 
 - Issue #21155: asyncio.EventLoop.create_unix_server() now raises a ValueError