Skip to content

Deleting an Entry does not delete attachments in it #397

@nkr0

Description

@nkr0

Deleting an Entry does not seem to remove attachments.

import pykeepass

kp = pykeepass.create_database("test")
e = kp.add_entry(kp.root_group, "title", "username", "password")
a = kp.add_binary(b"attachment data bytes string", False, False)
e.add_attachment(a, "attachment")
kp.dump_xml("before.xml")
print("before deleting entry", kp.binaries[a])
kp.delete_entry(e)
kp.dump_xml("after.xml")
print("after deleting entry", kp.binaries[a])

In secrets this can cause orphaned objects to be present in the database. https://gitlab.gnome.org/World/secrets/-/issues/574

P.S. PyKeePass.dump_xml does not seem to include binaries/attachments in it.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions