Closed rtl19 closed 2 years ago
Can you give more information, like your OS and pykeepass version? I'm not able to reproduce this.
>>> from pykeepass import PyKeePass; kp = PyKeePass('test4.kdbx', 'password', 'test4.key')
>>> kp.password
'password'
>>> kp.password = 'password1'
>>> kp.save()
>>> from pykeepass import PyKeePass; kp = PyKeePass('test4.kdbx', 'password1', 'test4.key')
Are you sure that newpasswordstring
is actually a string and not a tuple?
Hi @Evidlo , I'm using python 3.8 on Windows 10 using the latest installed pykeepass pip. Unfortunately, I won't be able to give you the actual version number until Monday. I also tried this using python 3.6 and had the same error. i'm fairly certain newpasswordstring is actually a string but I'll double check that as well. I'll also specifically cast it to a string as a test.
I get the same result as you when I try to set the password to something that isn't a string. I've fixed the database clobbering issue in 4.0.2
@Evidlo , the tuple problem was in my code. Thank you for helping me find it.
I'm probably doing this wrong. I tried changing the master password using the following:
keepass.password = newpasswordstring
However, doing so gives me the following error: `line 114, in compute_key_composite
AttributeError: "tuple" object has no attribute "encode"`
The worst part is it totally corrupts the database file from this point.