Skip to content

Commit 3541dfa

Browse files
committed
Merge pull request google#38 from mitya57/master
Fix converting bytearray to string
2 parents 6f4026e + 6f3413b commit 3541dfa

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

samples/apps/marketplace_sample/gdata/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ def GetAuthHeader(self, http_method, http_url):
938938
timestamp = int(math.floor(time.time()))
939939
nonce = '%lu' % random.randrange(1, 2**64)
940940
data = '%s %s %d %s' % (http_method, str(http_url), timestamp, nonce)
941-
sig = encodestring(self.rsa_key.hashAndSign(data).tostring()).rstrip()
941+
sig = encodestring(str(self.rsa_key.hashAndSign(data))).rstrip()
942942
header = {'Authorization': '%s"%s" data="%s" sig="%s" sigalg="rsa-sha1"' %
943943
(AUTHSUB_AUTH_LABEL, self.token_string, data, sig)}
944944
return header

src/gdata/auth.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -938,7 +938,7 @@ def GetAuthHeader(self, http_method, http_url):
938938
timestamp = int(math.floor(time.time()))
939939
nonce = '%lu' % random.randrange(1, 2**64)
940940
data = '%s %s %d %s' % (http_method, str(http_url), timestamp, nonce)
941-
sig = encodestring(self.rsa_key.hashAndSign(data).tostring()).rstrip()
941+
sig = encodestring(str(self.rsa_key.hashAndSign(data))).rstrip()
942942
header = {'Authorization': '%s"%s" data="%s" sig="%s" sigalg="rsa-sha1"' %
943943
(AUTHSUB_AUTH_LABEL, self.token_string, data, sig)}
944944
return header

0 commit comments

Comments
 (0)