Skip to content

Commit e177d1a

Browse files
committed
Replaced usage of base64.encodestring with base64.b64encode (encodestring may add newlines depending on string length)
1 parent fb34380 commit e177d1a

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

python/2.x/testrail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -55,7 +55,7 @@ def __send_request(self, method, uri, data):
5555
request = urllib2.Request(url)
5656
if (method == 'POST'):
5757
request.add_data(json.dumps(data))
58-
auth = base64.encodestring('%s:%s' % (self.user, self.password)).strip()
58+
auth = base64.b64encode('%s:%s' % (self.user, self.password))
5959
request.add_header('Authorization', 'Basic %s' % auth)
6060
request.add_header('Content-Type', 'application/json')
6161

python/3.x/testrail.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -57,7 +57,7 @@ def __send_request(self, method, uri, data):
5757
if (method == 'POST'):
5858
request.data = bytes(json.dumps(data), 'utf-8')
5959
auth = str(
60-
base64.encodestring(
60+
base64.b64encode(
6161
bytes('%s:%s' % (self.user, self.password), 'utf-8')
6262
),
6363
'ascii'

0 commit comments

Comments
 (0)