8000 Fix for 'TypeError: string argument without an encoding' (regressing … · pythonAI/client_python@1ba7c2e · GitHub
[go: up one dir, main page]

Skip to content

Commit 1ba7c2e

Browse files
committed
Fix for 'TypeError: string argument without an encoding' (regressing in python3).
1 parent daa40fd commit 1ba7c2e

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

prometheus_client/exposition.py

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,8 @@ def handle():
146146
'''
147147
if username is not None and password is not None:
148148
auth_value = "{0}:{1}".format(username, password)
149-
auth_header = "Basic {0}".format(base64.b64encode(bytes(auth_value, 'utf8')))
149+
auth_token = base64.b64encode(auth_value)
150+
auth_header = "Basic {0}".format(auth_token)
150151
headers.append(['Authorization', auth_header])
151152
default_handler(url, method, timeout, headers, data)()
152153

0 commit comments

Comments
 (0)
0