Comments (3)
I finally figured this out by looking at the test cases here.
Turns out you have to call kp.reload() after the first kp.save() if you want to keep modifying binaries after a save.
Can this be made explicit in the documentation? In particular because other database actions (e.g., adding entries) do not require a reload if there is a save between them, so this behavior is non-standard and unintuitive.
(Even though the original problem has been fixed, I'll keep this issue open to flag the suggested documentation update.)
from pykeepass.
I'm not able to reproduce this with your example. Here's my slightly modified code
from pykeepass import PyKeePass
db, password, key = 'test4.kdbx', 'password', 'test4.key'
kp = PyKeePass(db, password, key)
print('before:', kp.binaries)
e = kp.add_entry(kp.root_group, "foo", "", "")
binary_id = kp.add_binary("bar".encode())
e.add_attachment(binary_id, "baz.txt")
kp.save()
kp.delete_binary(binary_id)
kp.save()
kp2 = PyKeePass(db, password, key)
print('after:', kp2.binaries)
I even deleted the self.kp_tmp.reload()
you linked to in tests.py
and the tests still pass.
from pykeepass.
I'll assume this is resolved. Reopen if not.
from pykeepass.
Related Issues (20)
- Multiple tags are treated as one when working on kdbx from KeepassXC HOT 2
- construct.core.ChecksumError: Error in path (parsing) -> cred_check HOT 2
- entry.set_custom_property("field_name",value) corrupts database HOT 3
- 4.0.4: no documentation? 🤔 HOT 2
- Crashes when opening item without expiration date HOT 1
- Python 2 support (dependency on future) HOT 4
- How to edit a shared group? HOT 2
- RFE: please start making github releases HOT 1
- Provide access to master seed HOT 3
- What is the right approach to duplicate a group with all of its subgroups and entries?
- Feature Request: Add option to provide keyfile as bytes HOT 4
- It does not decodes entry.password for KeePass 2.53.1 64-bit HOT 5
- Bug: xml keyfiles with unexpected structure leads to errors HOT 1
- Add option to set creation/modification date HOT 1
- TOTP support HOT 3
- All fields of items created in GNOME Secrets are hidden HOT 17
- [4.0.7] regression -> gnome secrets crashes on expiration date check with missmatch of date format HOT 7
- crash if reference is broken
- create PyKeePassException HOT 3
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pykeepass.