jenkins-bot has submitted this change and it was merged.
Change subject: [FIX] threadedhttp: Don't unpack exceptions ......................................................................
[FIX] threadedhttp: Don't unpack exceptions
If the redirect issued an exception, it shouldn't be unpacked but instead directly returned like a normal exception.
Change-Id: Iaf548e569e774c6ee4682edf5f571b12321588d7 --- M pywikibot/comms/threadedhttp.py 1 file changed, 5 insertions(+), 3 deletions(-)
Approvals: John Vandenberg: Looks good to me, approved XZise: Looks good to me, but someone else must approve jenkins-bot: Verified
diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py index 43358ef..e3c0e64 100644 --- a/pywikibot/comms/threadedhttp.py +++ b/pywikibot/comms/threadedhttp.py @@ -254,10 +254,12 @@ method in ["GET", "HEAD"])) if (self.follow_redirects and (max_redirects > 0) and redirectable_response): - (response, content) = self._follow_redirect( + # Return directly and not unpack the values in case the result was + # an exception, which can't be unpacked + return self._follow_redirect( uri, method, body, headers, response, content, max_redirects) - - return response, content + else: + return response, content
def _follow_redirect(self, uri, method, body, headers, response, content, max_redirects):
pywikibot-commits@lists.wikimedia.org