summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLars Wirzenius <liw@liw.fi>2016-10-07 19:40:26 +0300
committerLars Wirzenius <liw@liw.fi>2016-10-07 19:40:26 +0300
commit292e396e4b8a56c2f167b81bc4441d35a4342419 (patch)
treeff7288bbad4df3439cc0f26c825ac7bf5ed51a65
parent7f29ce1d15b036600e225735f7618052e4f8fc06 (diff)
downloadobnam-292e396e4b8a56c2f167b81bc4441d35a4342419.tar.gz
Add gpg command line to error message about gpg failing
-rw-r--r--NEWS3
-rw-r--r--obnamlib/encryption.py8
2 files changed, 8 insertions, 3 deletions
diff --git a/NEWS b/NEWS
index 178ee271..c1f69527 100644
--- a/NEWS
+++ b/NEWS
@@ -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