Skip to content

Commit 81a2f76

Browse files
committed
Fixed macOS keychain access when using Python 3
Python 3 is returning bytes rather than a string, so the string concatenation to create the auth variable was throwing an exception which the script was interpreting to mean it couldn't find the password. Adding a conversion to string first fixed the issue.
1 parent 252c254 commit 81a2f76

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

bin/github-backup

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -337,6 +337,8 @@ def get_auth(args, encode=True):
337337
'-s', args.osx_keychain_item_name,
338338
'-a', args.osx_keychain_item_account,
339339
'-w'], stderr=devnull).strip())
340+
if not PY2:
341+
token = token.decode('utf-8')
340342
auth = token + ':' + 'x-oauth-basic'
341343
except:
342344
log_error('No password item matching the provided name and account could be found in the osx keychain.')

0 commit comments

Comments
 (0)