In class Entry
|
def __init__(self, title=None, username=None, password=None, url=None, |
|
notes=None, otp=None, tags=None, expires=False, expiry_time=None, |
|
icon=None, autotype_sequence=None, autotype_enabled=True, autotype_window=None, |
|
element=None, kp=None): |
title, username, password accept None as input.
|
self._element.append(E.String(E.Key('Title'), E.Value(title or ""))) |
|
self._element.append(E.String(E.Key('UserName'), E.Value(username or ""))) |
|
self._element.append( |
|
E.String(E.Key('Password'), E.Value(password or "", Protected="True")) |
|
) |
But E.Value() reject None.
Since keepass allows entry with no title username or password,this will cause exception.
if title:
self._element.append(E.String(E.Key('Title'), E.Value(title)))
if username:
self._element.append(E.String(E.Key('UserName'), E.Value(username)))
if password:
self._element.append(E.String(E.Key('Password'), E.Value(password, Protected="True")))
I think add NoneType check would be better.
In class Entry
pykeepass/pykeepass/entry.py
Lines 27 to 30 in 7b9219b
title, username, password accept None as input.
pykeepass/pykeepass/entry.py
Lines 42 to 46 in 7b9219b
But E.Value() reject None.
Since keepass allows entry with no title username or password,this will cause exception.
I think add NoneType check would be better.