You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Also, since PyKeePass has been developed in a declarative way (a la C) rather than the Pythonic way, the libkeepass context manager isn't reused and pykeepass fakes the use of the libkeypass context manager by calling its underlying method (open.__enter__()) manually.
And finally, when calling the resource manager manually, depending on the garbage collector implementation (e.g.: CPython), the file descriptor might not be freed correctly leading in resources/memory leaks. The garbage collector never calls __exit__() explicitly, only with-statements do that. It's generally bad to depend on the garbage collector to trigger cleanup code anyways. This is why closing the file stream from the underlying library is recommended (especially and the mechanisms included in that lib are being deconstructed by the piece of software making use of it).
The text was updated successfully, but these errors were encountered:
In this use case calling the close method from the underlying libkeepass doesn't work as there is no reference to it any more. It this for this particular use case, Python is smart enough to figure out to close the stream used by the underlying library.
The password you provided is incorrect or the KeePass file is invalid or has been corrupted.
Exception ignored in: <bound method PyKeePass.__del__ of <pykeepass.pykeepass.PyKeePass object at 0x7fa9e357dbe0>>
Traceback (most recent call last):
File "/home/wget/python_libo_to_keepass/pykeepass/pykeepass.py", line 33, in __del__
self.kdb.close()
AttributeError: 'PyKeePass' object has no attribute 'kdb'
Like described in the code, pykeepass has to recreate a write file stream in order to write to the context manager, because the libkeepass does only provide a context manager managing a read-only stream.
Also, since PyKeePass has been developed in a declarative way (a la C) rather than the Pythonic way, the libkeepass context manager isn't reused and pykeepass fakes the use of the libkeypass context manager by calling its underlying method (
open.__enter__()
) manually.And finally, when calling the resource manager manually, depending on the garbage collector implementation (e.g.: CPython), the file descriptor might not be freed correctly leading in resources/memory leaks. The garbage collector never calls
__exit__()
explicitly, only with-statements do that. It's generally bad to depend on the garbage collector to trigger cleanup code anyways. This is why closing the file stream from the underlying library is recommended (especially and the mechanisms included in that lib are being deconstructed by the piece of software making use of it).The text was updated successfully, but these errors were encountered: