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

Skip to content

Commit daa40fd

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

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

prometheus_client/exposition.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -146,7 +146,7 @@ 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)))
149+
auth_header = "Basic {0}".format(base64.b64encode(bytes(auth_value, 'utf8')))
150150
headers.append(['Authorization', auth_header])
151151
default_handler(url, method, timeout, headers, data)()
152152

0 commit comments

Comments
 (0)
0