From 81a2f762da5a0ee4c54792ba2174e6775cd0aa3e Mon Sep 17 00:00:00 2001 From: Ben Baron Date: Mon, 6 Jan 2020 21:10:50 -0500 Subject: [PATCH] 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. --- bin/github-backup | 2 ++ 1 file changed, 2 insertions(+) diff --git a/bin/github-backup b/bin/github-backup index 06f3a42..9b01735 100755 --- a/bin/github-backup +++ b/bin/github-backup @@ -337,6 +337,8 @@ def get_auth(args, encode=True): '-s', args.osx_keychain_item_name, '-a', args.osx_keychain_item_account, '-w'], stderr=devnull).strip()) + if not PY2: + token = token.decode('utf-8') auth = token + ':' + 'x-oauth-basic' except: log_error('No password item matching the provided name and account could be found in the osx keychain.')