]> git.ipfire.org Git - thirdparty/Python/cpython.git/commitdiff
Forgot one. This makes test_urllib2.py pass.
authorGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 02:30:49 +0000 (02:30 +0000)
committerGuido van Rossum <guido@python.org>
Wed, 29 Aug 2007 02:30:49 +0000 (02:30 +0000)
Lib/base64.py

index 1b9f560cc6632f01cd755e158fa1c6079f111c02..e100e0fab02ee239feed48fdeb2a38b59331085e 100755 (executable)
@@ -50,7 +50,7 @@ def b64encode(s, altchars=None):
     The encoded byte string is returned.
     """
     if not isinstance(s, bytes):
-        s = bytes(s)
+        s = bytes(s, "ascii")
     # Strip off the trailing newline
     encoded = binascii.b2a_base64(s)[:-1]
     if altchars is not None: