jenkins-bot submitted this change.
[bugfix] HttpRequest.raw may be None and has no decode() method
Change-Id: I38dce9932047a5825578a568c107b6d3b976b7fd
---
M pywikibot/comms/threadedhttp.py
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/pywikibot/comms/threadedhttp.py b/pywikibot/comms/threadedhttp.py
index 7148768..174ea1f 100644
--- a/pywikibot/comms/threadedhttp.py
+++ b/pywikibot/comms/threadedhttp.py
@@ -224,7 +224,8 @@
@deprecated('the `text` property', since='20201011', future_warning=True)
def decode(self, encoding, errors='strict') -> str:
"""Return the decoded response."""
- return self.raw.decode(encoding, errors)
+ return self.raw.decode(encoding,
+ errors) if not self.exception else None
@property
@deprecated('the `text` property', since='20180321', future_warning=True)
To view, visit change 636021. To unsubscribe, or for help writing mail filters, visit settings.