diff options
author | Guido van Rossum <guido@python.org> | 2000-04-04 20:53:07 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2000-04-04 20:53:07 (GMT) |
commit | 13c8c0272a2f65e7cd2a3c88de05c8a285915d9d (patch) | |
tree | 70fa3ed0fc25b32b0dca861cd6d4a418e463a62b /Lib | |
parent | 12ed36525a83ab2d2f402c5fa2192412612206c1 (diff) | |
download | cpython-13c8c0272a2f65e7cd2a3c88de05c8a285915d9d.zip cpython-13c8c0272a2f65e7cd2a3c88de05c8a285915d9d.tar.gz cpython-13c8c0272a2f65e7cd2a3c88de05c8a285915d9d.tar.bz2 |
Skip Montanaro submits a simple patch that makes encode() and decode()
recognize the '7bit' and '8bit' encodings, to simplify use.
Diffstat (limited to 'Lib')
-rw-r--r-- | Lib/mimetools.py | 4 |
1 files changed, 4 insertions, 0 deletions
diff --git a/Lib/mimetools.py b/Lib/mimetools.py index b519c54..27996e0 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: |