summaryrefslogtreecommitdiff
path: root/Lib/base64.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/base64.py')
-rwxr-xr-xLib/base64.py3
1 files changed, 1 insertions, 2 deletions
diff --git a/Lib/base64.py b/Lib/base64.py
index 640f787c73..eb925cd4c5 100755
--- a/Lib/base64.py
+++ b/Lib/base64.py
@@ -58,8 +58,7 @@ def b64encode(s, altchars=None):
The encoded byte string is returned.
"""
- # Strip off the trailing newline
- encoded = binascii.b2a_base64(s)[:-1]
+ encoded = binascii.b2a_base64(s, newline=False)
if altchars is not None:
assert len(altchars) == 2, repr(altchars)
return encoded.translate(bytes.maketrans(b'+/', altchars))