From ae4974a2d13c69eed766b8bbffaf38f0875be9b2 Mon Sep 17 00:00:00 2001 From: Hunter Chambers Date: Tue, 27 Sep 2022 18:05:40 -0400 Subject: [PATCH] Closes #460: python-gnupg version increase breaks unencrypt_file function --- dbbackup/utils.py | 4 +++- docs/configuration.rst | 2 +- requirements/tests.txt | 2 +- 3 files changed, 5 insertions(+), 3 deletions(-) diff --git a/dbbackup/utils.py b/dbbackup/utils.py index 30aec8d3..e7cf3109 100644 --- a/dbbackup/utils.py +++ b/dbbackup/utils.py @@ -228,7 +228,9 @@ def get_passphrase(passphrase=passphrase): inputfile.seek(0) g = gnupg.GPG() result = g.decrypt_file( - file=inputfile, passphrase=get_passphrase(), output=temp_filename + fileobj_or_path=inputfile, + passphrase=get_passphrase(), + output=temp_filename, ) if not result: raise DecryptionError("Decryption failed; status: %s" % result.status) diff --git a/docs/configuration.rst b/docs/configuration.rst index a290108b..ba209eea 100644 --- a/docs/configuration.rst +++ b/docs/configuration.rst @@ -119,7 +119,7 @@ using GPG. :: Requirements: - Install the python package python-gnupg: - ``pip install python-gnupg``. + ``pip install python-gnupg>=0.5.0``. - You need a GPG key. (`GPG manual`_) - Set the setting ``DBBACKUP_GPG_RECIPIENT`` to the name of the GPG key. diff --git a/requirements/tests.txt b/requirements/tests.txt index e294db57..e975d619 100644 --- a/requirements/tests.txt +++ b/requirements/tests.txt @@ -6,7 +6,7 @@ pep8 psycopg2 pylint python-dotenv -python-gnupg +python-gnupg>=0.5.0 pytz testfixtures tox