diff options
author | Matheus <matheuspatury@gmail.com> | 2013-09-26 18:43:33 -0700 |
---|---|---|
committer | Matheus <matheuspatury@gmail.com> | 2013-09-26 18:43:33 -0700 |
commit | a39059030d511eddb70500bc9fa01df3d38f2905 (patch) | |
tree | 9685356b2f8ee793ac22aac15082834f967a9051 /awsauth.py | |
parent | d6e637cfeb6df8d1fc3e40d4d40fe815d9f9fabe (diff) | |
download | python-requests-aws-a39059030d511eddb70500bc9fa01df3d38f2905.tar.gz |
fix issues to work in Python 3.3.2
Diffstat (limited to 'awsauth.py')
-rw-r--r-- | awsauth.py | 6 |
1 files changed, 5 insertions, 1 deletions
@@ -6,9 +6,13 @@ from hashlib import sha1 as sha py3k = False try: from urlparse import urlparse + from base64 import encodestring + except: py3k = True from urllib.parse import urlparse + from base64 import encodebytes as encodestring + from email.utils import formatdate from requests.auth import AuthBase @@ -57,7 +61,7 @@ class S3Auth(AuthBase): key = self.secret_key msg = canonical_string h = hmac.new(key, msg, digestmod=sha) - return base64.encodestring(h.digest()).strip() + return encodestring(h.digest()).strip() def get_canonical_string(self, url, headers, method): parsedurl = urlparse(url) |