jenkins-bot submitted this change.

View Change

Approvals: Mpaa: Looks good to me, approved jenkins-bot: Verified
[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.

Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Change-Id: I38dce9932047a5825578a568c107b6d3b976b7fd
Gerrit-Change-Number: 636021
Gerrit-PatchSet: 3
Gerrit-Owner: Xqt <info@gno.de>
Gerrit-Reviewer: Mpaa <mpaa.wiki@gmail.com>
Gerrit-Reviewer: jenkins-bot
Gerrit-MessageType: merged