Crashes if I try to open unsupported file
- Open Secrets
- Ctrl+O
- Select a file that is not a KeePass database (I used ~/.pwsafe.dat because I wanted to see if Secrets supports PasswordSafe databases)
- Enter the file passphrase, press Enter
Secrets window disappears.
If I run Secrets from a terminal, then I can see what caused the crash:
(secrets:2): Gtk-WARNING **: 14:05:48.229: GtkText - did not receive a focus-out event.
If you handle this event, you must return
GDK_EVENT_PROPAGATE so the default handler
gets the event as well
Traceback (most recent call last):
File "/app/lib/python3.9/site-packages/gsecrets/unlock_database.py", line 270, in _unlock_callback
database = UnlockedDatabase(self.window, database_manager)
File "/app/lib/python3.9/site-packages/gsecrets/unlocked_database.py", line 70, in __init__
root_group = SafeGroup.get_root(dbm)
File "/app/lib/python3.9/site-packages/gsecrets/safe_element.py", line 242, in get_root
return SafeGroup(db_manager, db_manager.db.root_group)
File "/app/lib/python3.9/site-packages/pykeepass/pykeepass.py", line 205, in root_group
return self.find_groups(path='', first=True)
File "/app/lib/python3.9/site-packages/pykeepass/pykeepass.py", line 383, in find_groups
res = self._find(prefix, group_xp, path=path, tree=group, **kwargs)
File "/app/lib/python3.9/site-packages/pykeepass/pykeepass.py", line 356, in _find
res = self._xpath(
File "/app/lib/python3.9/site-packages/pykeepass/pykeepass.py", line 279, in _xpath
tree = self.tree
File "/app/lib/python3.9/site-packages/pykeepass/pykeepass.py", line 200, in tree
return self.kdbx.body.payload.xml
AttributeError: 'NoneType' object has no attribute 'payload'