summaryrefslogtreecommitdiff
path: root/Lib/base64.py
diff options
context:
space:
mode:
authorGuido van Rossum <guido@python.org>2007-08-27 22:27:41 +0000
committerGuido van Rossum <guido@python.org>2007-08-27 22:27:41 +0000
commit54a40cb81f2bbc7ec263196eaa4ce05151ab93ce (patch)
treeca2c376286d42ae43d737d7cd385da5ffc4dd02e /Lib/base64.py
parent98b349f8e6efc5c1994e506c02a755f311d49f03 (diff)
downloadcpython-git-54a40cb81f2bbc7ec263196eaa4ce05151ab93ce.tar.gz
Force test_xmlrpc to pass. I'm not happy with how I did this, but I don't
see a better way; the 'Binary' class is poorly specified so it's unclear what behavior is relied upon.
Diffstat (limited to 'Lib/base64.py')
-rwxr-xr-xLib/base64.py14
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/base64.py b/Lib/base64.py
index 5d42065e2d..1b9f560cc6 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -298,7 +298,7 @@ MAXLINESIZE = 76 # Excluding the CRLF
MAXBINSIZE = (MAXLINESIZE//4)*3
def encode(input, output):
- """Encode a file."""
+ """Encode a file; input and output are binary files."""
while True:
s = input.read(MAXBINSIZE)
if not s:
@@ -313,7 +313,7 @@ def encode(input, output):
def decode(input, output):
- """Decode a file."""
+ """Decode a file; input and output are binary files."""
while True:
line = input.readline()
if not line:
@@ -323,7 +323,10 @@ def decode(input, output):
def encodestring(s):
- """Encode a string into multiple lines of base-64 data."""
+ """Encode a string into multiple lines of base-64 data.
+
+ Argument and return value are bytes.
+ """
if not isinstance(s, bytes):
raise TypeError("expected bytes, not %s" % s.__class__.__name__)
pieces = []
@@ -334,7 +337,10 @@ def encodestring(s):
def decodestring(s):
- """Decode a string."""
+ """Decode a string.
+
+ Argument and return value are bytes.
+ """
if not isinstance(s, bytes):
raise TypeError("expected bytes, not %s" % s.__class__.__name__)
return binascii.a2b_base64(s)