From 75b0c4be1b71831768e44517b63258f68b04792e Mon Sep 17 00:00:00 2001 From: Kenneth Reitz Date: Wed, 15 Feb 2012 02:01:36 -0500 Subject: [PATCH] latin1, remove unicode_literals Fixes #407 --- requests/auth.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/requests/auth.py b/requests/auth.py index 183731bd..2e2bebcb 100644 --- a/requests/auth.py +++ b/requests/auth.py @@ -7,8 +7,6 @@ requests.auth This module contains the authentication handlers for Requests. """ -from __future__ import unicode_literals - import time import hashlib @@ -21,7 +19,7 @@ from .utils import randombytes, parse_dict_header def _basic_auth_str(username, password): """Returns a Basic Auth string.""" - return 'Basic ' + b64encode(("%s:%s" % (username, password)).encode('utf-8')).strip().decode('utf-8') + return 'Basic ' + b64encode(('%s:%s' % (username, password)).encode('latin1')).strip().decode('latin1') class AuthBase(object):