Skip to content

Commit

Permalink
Fix AttributeError in case python-keyring-keytils is installed
Browse files Browse the repository at this point in the history
This is a band-aid for now.

It would be preferable to:

- show a warning about the "wrong" module being installed
- or, even better, implement support for the alternative module
  • Loading branch information
coldfix committed Apr 16, 2024
1 parent 08bdbff commit cc312f7
Showing 1 changed file with 5 additions and 1 deletion.
6 changes: 5 additions & 1 deletion udiskie/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -4,12 +4,16 @@

import keyutils

# This import fails in python-keyring-keyutils, which is a not (yet) supported
# alternative for the python-keyring package. This lets us distinguish between
# the two identically named python packages (=keyring).
from keyutils import KEY_SPEC_PROCESS_KEYRING

class PasswordCache:

def __init__(self, timeout):
self.timeout = timeout
self.keyring = keyutils.KEY_SPEC_PROCESS_KEYRING
self.keyring = KEY_SPEC_PROCESS_KEYRING

def _key(self, device):
return device.id_uuid.encode('utf-8')
Expand Down

0 comments on commit cc312f7

Please sign in to comment.