From 13c8c0272a2f65e7cd2a3c88de05c8a285915d9d Mon Sep 17 00:00:00 2001 From: Guido van Rossum Date: Tue, 4 Apr 2000 20:53:07 +0000 Subject: [PATCH] Skip Montanaro submits a simple patch that makes encode() and decode() recognize the '7bit' and '8bit' encodings, to simplify use. --- Lib/mimetools.py | 4 ++++ 1 file changed, 4 insertions(+) diff --git a/Lib/mimetools.py b/Lib/mimetools.py index b519c54cdbe..27996e04cb4 100644 --- a/Lib/mimetools.py +++ b/Lib/mimetools.py @@ -140,6 +140,8 @@ def decode(input, output, encoding): if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'): import uu return uu.decode(input, output) + if encoding in ('7bit', '8bit'): + output.write(input.read()) if decodetab.has_key(encoding): pipethrough(input, decodetab[encoding], output) else: @@ -157,6 +159,8 @@ def encode(input, output, encoding): if encoding in ('uuencode', 'x-uuencode', 'uue', 'x-uue'): import uu return uu.encode(input, output) + if encoding in ('7bit', '8bit'): + output.write(input.read()) if encodetab.has_key(encoding): pipethrough(input, encodetab[encoding], output) else: