Skip to content

Commit 9e608ff

Browse files
committed
123 update: python3 support for auth encoding
1 parent 69d11f6 commit 9e608ff

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

github_backup/github_backup.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -515,6 +515,8 @@ def _construct_request(per_page, page, query_args, template, auth, as_app=None):
515515
if not as_app:
516516
request.add_header('Authorization', 'Basic '.encode('ascii') + auth)
517517
else:
518+
if not PY2:
519+
auth = auth.encode('ascii')
518520
request.add_header('Authorization', 'token '.encode('ascii') + auth)
519521
request.add_header('Accept', 'application/vnd.github.machine-man-preview+json')
520522
log_info('Requesting {}?{}'.format(template, querystring))

0 commit comments

Comments
 (0)