diff --git a/Lib/encodings/rot_13.py b/Lib/encodings/rot_13.py index 1f2f47bb34f..f0b4186dc87 100755 --- a/Lib/encodings/rot_13.py +++ b/Lib/encodings/rot_13.py @@ -106,7 +106,7 @@ def getregentry(): ### 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 diff --git a/Misc/NEWS b/Misc/NEWS index 0b558727ba1..949d8e69772 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -34,6 +34,9 @@ Core and Builtins Library ------- +- Issue #21171: Fixed undocumented filter API of the rot13 codec. + Patch by Berker Peksag. + - Issue #20539: Improved math.factorial error message for large positive inputs and changed exception type (OverflowError -> ValueError) for large negative inputs.