Skip Montanaro submits a simple patch that makes encode() and decode()

recognize the '7bit' and '8bit' encodings, to simplify use.
This commit is contained in:
Guido van Rossum 2000-04-04 20:53:07 +00:00
parent 12ed36525a
commit 13c8c0272a
1 changed files with 4 additions and 0 deletions

View File

@ -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: