From f9d16fb24f077f08107ae6544a98e7c2da6b43f3 Mon Sep 17 00:00:00 2001 From: Gabriel Proust Date: Fri, 25 Dec 2020 16:46:10 +0100 Subject: [PATCH 1/2] Update README about the new empty database creation --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0f8fb4f..9d4c66e 100644 --- a/README.md +++ b/README.md @@ -12,7 +12,7 @@ make build ``` ## Run/usage -- First you will need to **create new (empty) KeePass database** (tested with [KeePassXC](https://github.com/keepassxreboot/keepassxc) but it will probably work with others) +- You can either **create new (empty) KeePass database** (tested with [KeePassXC](https://github.com/keepassxreboot/keepassxc) but it will probably work with others) right now, otherwise one will be created when the script is executed - Go into the virtual environment ``` source .venv/bin/activate From c0c31cee5b8eff16d5f202c26953ee35cda7aab8 Mon Sep 17 00:00:00 2001 From: Gabriel Proust Date: Fri, 25 Dec 2020 16:42:58 +0100 Subject: [PATCH 2/2] Use CredentialsError from pykeepass instead of CredentialsIntegrityError --- bitwarden-to-keepass.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bitwarden-to-keepass.py b/bitwarden-to-keepass.py index c1a46fe..8a4b1e9 100644 --- a/bitwarden-to-keepass.py +++ b/bitwarden-to-keepass.py @@ -7,7 +7,7 @@ from argparse import ArgumentParser from shlex import quote from pykeepass import PyKeePass, create_database -from pykeepass.exceptions import CredentialsIntegrityError +from pykeepass.exceptions import CredentialsError from item import Item, Types as ItemTypes @@ -20,7 +20,7 @@ def bitwarden_to_keepass(args): except FileNotFoundError: logging.info('KeePass database does not exist, creating a new one.') kp = create_database(args.database_path, password=args.database_password, keyfile=args.database_keyfile) - except CredentialsIntegrityError as e: + except CredentialsError as e: logging.error(f'Wrong password for KeePass database: {e}') return