summaryrefslogtreecommitdiffstats
path: root/Lib/logging
diff options
context:
space:
mode:
authorVinay Sajip <vinay_sajip@yahoo.co.uk>2016-06-07 20:19:55 (GMT)
committerVinay Sajip <vinay_sajip@yahoo.co.uk>2016-06-07 20:19:55 (GMT)
commit1bf197eb14c5db5c43b3dc48687ae034690d34c4 (patch)
treec89ef3520e3ee1bf8f9cc6d7f2d725d6562d7855 /Lib/logging
parent8bff8f6953f3256aa75871840fd89e40240d7ad7 (diff)
downloadcpython-1bf197eb14c5db5c43b3dc48687ae034690d34c4.zip
cpython-1bf197eb14c5db5c43b3dc48687ae034690d34c4.tar.gz
cpython-1bf197eb14c5db5c43b3dc48687ae034690d34c4.tar.bz2
Fixed #27251: corrected string/bytes handling in credentials.
Diffstat (limited to 'Lib/logging')
-rw-r--r--Lib/logging/handlers.py4
1 files changed, 2 insertions, 2 deletions
diff --git a/Lib/logging/handlers.py b/Lib/logging/handlers.py
index c6840c3..c9f8217 100644
--- a/Lib/logging/handlers.py
+++ b/Lib/logging/handlers.py
@@ -1156,8 +1156,8 @@ class HTTPHandler(logging.Handler):
h.putheader("Content-length", str(len(data)))
if self.credentials:
import base64
- s = ('u%s:%s' % self.credentials).encode('utf-8')
- s = 'Basic ' + base64.b64encode(s).strip()
+ s = ('%s:%s' % self.credentials).encode('utf-8')
+ s = 'Basic ' + base64.b64encode(s).strip().decode('ascii')
h.putheader('Authorization', s)
h.endheaders()
if self.method == "POST":