diff options
author | Nick Tarleton <nick@quixey.com> | 2011-04-02 11:37:55 -0700 |
---|---|---|
committer | garnaat <mitch@garnaat.com> | 2011-04-02 17:48:59 -0400 |
commit | 2dc32d7d861bb532e0bda20dbe64e8c4c8b9b1e3 (patch) | |
tree | 42e2d4f1418d2611a10e7643d4189cc4d38c89f8 /boto/auth.py | |
parent | 63bf4e8a6fb61bd83ded14d3c3796d502076ef23 (diff) | |
download | boto-branch_master_python3k.tar.gz |
fix base64.encode{bytes,string} Python 2 regressionbranch_master_python3k
Diffstat (limited to 'boto/auth.py')
-rw-r--r-- | boto/auth.py | 4 |
1 files changed, 3 insertions, 1 deletions
diff --git a/boto/auth.py b/boto/auth.py index 91440524..17280f77 100644 --- a/boto/auth.py +++ b/boto/auth.py @@ -42,9 +42,11 @@ from boto.exception import BotoClientError try: # Python 3.x from urllib.parse import quote + base64_encodestring = base64.encodebytes except ImportError: # Python 2.x from urllib import quote + base64_encodestring = base64.encodestring # # the following is necessary because of the incompatibilities @@ -101,7 +103,7 @@ class HmacKeys(object): else: hmac = self._hmac.copy() hmac.update(string_to_sign.encode('utf-8')) - return base64.encodebytes(hmac.digest()).strip().decode('utf-8') + return base64_encodestring(hmac.digest()).strip().decode('utf-8') class HmacAuthV1Handler(AuthHandler, HmacKeys): """ Implements the HMAC request signing used by S3 and GS.""" |