Fix the error format so we actually format the arguments instead of raising the format string and the arguments. Here is an upload error formatted correctly with this change: nbdkit: python[1]: error: /home/nsoffer/src/libguestfs/tmp/v2v.eC5yCl/rhv-upload-plugin.py: pwrite: error: could not write sector offset 218911744 size 3584: 403 Forbidden: b'{"explanation": "Access was denied to this resource.", "code": 403, "detail": "Ticket u\'61ac0483-48e3-4984-84d6-438884ba8bb2\' expired", "title": "Forbidden"}' --- v2v/rhv-upload-plugin.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/v2v/rhv-upload-plugin.py b/v2v/rhv-upload-plugin.py index 7327ea4c5..b5dd5521d 100644 --- a/v2v/rhv-upload-plugin.py +++ b/v2v/rhv-upload-plugin.py @@ -317,7 +317,7 @@ def request_failed(h, r, msg): debug(body) # Only a short error is included in the exception. - raise RuntimeError("%s: %d %s: %r", msg, status, reason, body[:200]) + raise RuntimeError("%s: %d %s: %r" % (msg, status, reason, body[:200])) # For documentation see: # https://github.com/oVirt/ovirt-imageio/blob/master/docs/random-io.md -- 2.17.1