Show More
@@ -240,7 +240,11 b' class PasswordStore(object):' | |||||
240 | """Physically write to keyring""" |
|
240 | """Physically write to keyring""" | |
241 | keyring = import_keyring() |
|
241 | keyring = import_keyring() | |
242 | # keyring in general expects unicode. |
|
242 | # keyring in general expects unicode. | |
243 | # Mercurial provides "local" encoding. See #33 |
|
243 | # Mercurial provides "local" encoding. See #33. | |
|
244 | # py3 adds even more fun as we get already unicode from getpass. | |||
|
245 | # To handle those quirks, let go through encoding.fromlocal in case we | |||
|
246 | # got bytestr here, this will handle both normal py2 and emergency py3 cases. | |||
|
247 | if isinstance(password, bytes): | |||
244 | password = encoding.fromlocal(password).decode('utf-8') |
|
248 | password = encoding.fromlocal(password).decode('utf-8') | |
245 | try: |
|
249 | try: | |
246 | keyring.set_password( |
|
250 | keyring.set_password( |
General Comments 0
You need to be logged in to leave comments.
Login now