summaryrefslogtreecommitdiff
path: root/Lib/quopri.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/quopri.py')
-rwxr-xr-xLib/quopri.py16
1 files changed, 7 insertions, 9 deletions
diff --git a/Lib/quopri.py b/Lib/quopri.py
index 3d0f0ac078..46c2a4c728 100755
--- a/Lib/quopri.py
+++ b/Lib/quopri.py
@@ -44,13 +44,11 @@ def quote(c):
def encode(input, output, quotetabs, header=False):
"""Read 'input', apply quoted-printable encoding, and write to 'output'.
- 'input' and 'output' are files with readline() and write() methods.
- The 'quotetabs' flag indicates whether embedded tabs and spaces should be
- quoted. Note that line-ending tabs and spaces are always encoded, as per
- RFC 1521.
- The 'header' flag indicates whether we are encoding spaces as _ as per
- RFC 1522.
- """
+ 'input' and 'output' are binary file objects. The 'quotetabs' flag
+ indicates whether embedded tabs and spaces should be quoted. Note that
+ line-ending tabs and spaces are always encoded, as per RFC 1521.
+ The 'header' flag indicates whether we are encoding spaces as _ as per RFC
+ 1522."""
if b2a_qp is not None:
data = input.read()
@@ -118,7 +116,7 @@ def encodestring(s, quotetabs=False, header=False):
def decode(input, output, header=False):
"""Read 'input', apply quoted-printable decoding, and write to 'output'.
- 'input' and 'output' are files with readline() and write() methods.
+ 'input' and 'output' are binary file objects.
If 'header' is true, decode underscore as space (per RFC 1522)."""
if a2b_qp is not None:
@@ -223,7 +221,7 @@ def main():
else:
try:
fp = open(file, "rb")
- except IOError as msg:
+ except OSError as msg:
sys.stderr.write("%s: can't open (%s)\n" % (file, msg))
sts = 1
continue