summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rwxr-xr-xLib/base64.py2
1 files changed, 1 insertions, 1 deletions
diff --git a/Lib/base64.py b/Lib/base64.py
index 1b9f560cc6..e100e0fab0 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -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: