diff options
-rw-r--r-- | NEWS | 3 | ||||
-rw-r--r-- | obnamlib/encryption.py | 8 |
2 files changed, 8 insertions, 3 deletions
@@ -49,6 +49,9 @@ Minor changes: starts, however. Also, `/proc/mounts` must be an accurate list of mount points. +* Lars Wirzenius added the gpg command line to the error message about + gpg failing. + Bug fixes: * The manual and manual page used to claim you could break only the diff --git a/obnamlib/encryption.py b/obnamlib/encryption.py index d2c78d07..45611401 100644 --- a/obnamlib/encryption.py +++ b/obnamlib/encryption.py @@ -1,4 +1,4 @@ -# Copyright 2011-2015 Lars Wirzenius +# Copyright 2011-2016 Lars Wirzenius # # This program is free software: you can redistribute it and/or modify # it under the terms of the GNU General Public License as published by @@ -30,7 +30,8 @@ class EncryptionError(obnamlib.ObnamError): class GpgError(EncryptionError): - msg = 'gpg failed with exit code {returncode}:\n{stderr}' + msg = ('gpg failed with exit code {returncode}:\n' + 'Command: {command}\n{stderr}') def generate_symmetric_key(numbits, filename='/dev/random'): @@ -129,7 +130,8 @@ def _gpg(args, stdin='', gpghome=None): # Return output data, or deal with errors. if p.returncode: # pragma: no cover - raise GpgError(returncode=p.returncode, stderr=err) + command = ' '.join(argv) + raise GpgError(command=command, returncode=p.returncode, stderr=err) return out |