Skip to content

Commit

Permalink
py32 fix: Basic auth base64 encode.
Browse files Browse the repository at this point in the history
  • Loading branch information
shazow committed Jan 29, 2012
1 parent f408958 commit 7866dc9
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion urllib3/connectionpool.py
Expand Up @@ -7,6 +7,7 @@
import logging
import socket

from base64 import b64encode
from socket import error as SocketError, timeout as SocketTimeout

try:
Expand Down Expand Up @@ -540,7 +541,7 @@ def make_headers(keep_alive=None, accept_encoding=None, user_agent=None,

if basic_auth:
headers['authorization'] = 'Basic ' + \
basic_auth.encode('base64').strip()
b64encode(six.b(basic_auth)).decode('utf-8')

return headers

Expand Down

0 comments on commit 7866dc9

Please sign in to comment.