diff options
author | Guido van Rossum <guido@python.org> | 2007-08-27 22:27:41 (GMT) |
---|---|---|
committer | Guido van Rossum <guido@python.org> | 2007-08-27 22:27:41 (GMT) |
commit | 54a40cb81f2bbc7ec263196eaa4ce05151ab93ce (patch) | |
tree | ca2c376286d42ae43d737d7cd385da5ffc4dd02e /Lib/base64.py | |
parent | 98b349f8e6efc5c1994e506c02a755f311d49f03 (diff) | |
download | cpython-54a40cb81f2bbc7ec263196eaa4ce05151ab93ce.zip cpython-54a40cb81f2bbc7ec263196eaa4ce05151ab93ce.tar.gz cpython-54a40cb81f2bbc7ec263196eaa4ce05151ab93ce.tar.bz2 |
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-x | Lib/base64.py | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/Lib/base64.py b/Lib/base64.py index 5d42065..1b9f560 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) |