Skip to content

Commit

Permalink
deprecated encodestring => encodebytes
Browse files Browse the repository at this point in the history
  • Loading branch information
Nick Tarleton authored and garnaat committed Apr 2, 2011
1 parent c6d6943 commit c1417e8
Show file tree
Hide file tree
Showing 4 changed files with 5 additions and 5 deletions.
2 changes: 1 addition & 1 deletion boto/auth.py
Expand Up @@ -101,7 +101,7 @@ def sign_string(self, string_to_sign):
else:
hmac = self._hmac.copy()
hmac.update(string_to_sign.encode('utf-8'))
return base64.encodestring(hmac.digest()).strip().decode('utf-8')
return base64.encodebytes(hmac.digest()).strip().decode('utf-8')

class HmacAuthV1Handler(AuthHandler, HmacKeys):
""" Implements the HMAC request signing used by S3 and GS."""
Expand Down
2 changes: 1 addition & 1 deletion boto/connection.py
Expand Up @@ -408,7 +408,7 @@ def prefix_proxy_to_path(self, path, host=None):
return path

def get_proxy_auth_header(self):
auth = base64.encodestring(self.proxy_user + ':' + self.proxy_pass)
auth = base64.encodebytes(self.proxy_user + ':' + self.proxy_pass)
return {'Proxy-Authorization': 'Basic %s' % auth}

def _mexe(self, method, path, data, headers, host=None, sender=None,
Expand Down
4 changes: 2 additions & 2 deletions boto/s3/key.py
Expand Up @@ -104,7 +104,7 @@ def get_md5_from_hexdigest(self, md5_hexdigest):
"""
import binascii
digest = binascii.unhexlify(md5_hexdigest)
base64md5 = base64.encodestring(digest)
base64md5 = base64.encodebytes(digest)
if base64md5[-1] == '\n':
base64md5 = base64md5[0:-1]
return (md5_hexdigest, base64md5)
Expand Down Expand Up @@ -540,7 +540,7 @@ def compute_md5(self, fp):
m.update(s)
s = fp.read(self.BufferSize)
hex_md5 = m.hexdigest()
base64md5 = base64.encodestring(m.digest())
base64md5 = base64.encodebytes(m.digest())
if base64md5[-1] == '\n':
base64md5 = base64md5[0:-1]
self.size = fp.tell()
Expand Down
2 changes: 1 addition & 1 deletion boto/sdb/db/manager/xmlmanager.py
Expand Up @@ -202,7 +202,7 @@ def __init__(self, cls, db_name, db_user, db_passwd,
self.auth_header = None
if self.db_user:
import base64
base64string = base64.encodestring('%s:%s' % (self.db_user, self.db_passwd))[:-1]
base64string = base64.encodebytes('%s:%s' % (self.db_user, self.db_passwd))[:-1]
authheader = "Basic %s" % base64string
self.auth_header = authheader

Expand Down

0 comments on commit c1417e8

Please sign in to comment.