I have updated the code to display multi-lines error messages better. And attached the patch to this email. (this was also merged in dput-ng).
Please consider applying this patch to dput. Cheers, -- Alexandre Viau av...@debian.org
From a51cb1aa992b3dd38856531755c51779de4b2981 Mon Sep 17 00:00:00 2001 From: aviau <av...@debian.org> Date: Tue, 5 Jun 2018 11:48:40 -0400 Subject: [PATCH] methods/http: display error messages --- dput/methods/http.py | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/dput/methods/http.py b/dput/methods/http.py index 5bd0fe7..9dd2ca5 100644 --- a/dput/methods/http.py +++ b/dput/methods/http.py @@ -153,6 +153,11 @@ def upload( auth_headers = AuthHandlerHackAround( url, res.msg, pwman).get_auth_headers() else: + error_message = res.read() + if error_message: + if "\n" in error_message: + error_message = "\n\t" + "\n\t".join(error_message.splitlines()) + sys.stdout.write("HTTP error message: %s\n" % error_message) if res.status == 401: sys.stdout.write( "Upload failed as unauthorized: %s\n" -- 2.17.1
signature.asc
Description: OpenPGP digital signature