From 9561a99d6ba62d3fcfce262e359ba31ce78e2fa7 Mon Sep 17 00:00:00 2001 From: Thorsten Behrens Date: Thu, 21 Nov 2013 23:46:45 +0100 Subject: [PATCH] Do not pass on unicode password from keyrings. Seems at least gnome keyring returns a unicode string here needlessly, which calling code then trips over. --- osc/conf.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/osc/conf.py b/osc/conf.py index 6a723138..6287d4e7 100644 --- a/osc/conf.py +++ b/osc/conf.py @@ -817,7 +817,7 @@ def get_config(override_conffile=None, try: # Read from keyring lib if available user = cp.get(url, 'user', raw=True) - password = keyring.get_password(host, user) + password = str(keyring.get_password(host, user)) except: # Fallback to file based auth. pass @@ -829,7 +829,7 @@ def get_config(override_conffile=None, raise oscerr.ConfigError('no user found in keyring', conffile) user = gk_data[0]['user'] if 'password' in gk_data[0]: - password = gk_data[0]['password'] + password = str(gk_data[0]['password']) else: # this is most likely an error print('warning: no password found in keyring', file=sys.stderr)