Skip to content

Commit

Permalink
Replaced usage of base64.encodestring with base64.b64encode (encodest…
Browse files Browse the repository at this point in the history
…ring may add newlines depending on string length)
  • Loading branch information
tgurock committed May 31, 2015
1 parent fb34380 commit e177d1a
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion python/2.x/testrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ def __send_request(self, method, uri, data):
request = urllib2.Request(url)
if (method == 'POST'):
request.add_data(json.dumps(data))
auth = base64.encodestring('%s:%s' % (self.user, self.password)).strip()
auth = base64.b64encode('%s:%s' % (self.user, self.password))
request.add_header('Authorization', 'Basic %s' % auth)
request.add_header('Content-Type', 'application/json')

Expand Down
2 changes: 1 addition & 1 deletion python/3.x/testrail.py
Original file line number Diff line number Diff line change
Expand Up @@ -57,7 +57,7 @@ def __send_request(self, method, uri, data):
if (method == 'POST'):
request.data = bytes(json.dumps(data), 'utf-8')
auth = str(
base64.encodestring(
base64.b64encode(
bytes('%s:%s' % (self.user, self.password), 'utf-8')
),
'ascii'
Expand Down

0 comments on commit e177d1a

Please sign in to comment.