jenkins-bot has submitted this change and it was merged.
Change subject: Enabling the error handling in decode method. ......................................................................
Enabling the error handling in decode method.
Enabled python implementation of error handling for the decode method of HttpRequest. It accepts the "errors" argument which can take the values like 'strict', 'replace' and 'ignore' according to need. 'strict' is the default value.
Bug: T88928 Change-Id: I02609a5abcdf0e5e66bbb4ffdcc41aaf74d5c943 --- M pywikibot/comms/threadedhttp.py 1 file changed, 2 insertions(+), 2 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 b7a7422..a2f6ef3 100644 --- a/pywikibot/comms/threadedhttp.py +++ b/pywikibot/comms/threadedhttp.py @@ -477,9 +477,9 @@ raise self._encoding return self._encoding
- def decode(self, encoding): + def decode(self, encoding, errors='strict'): """Return the decoded response.""" - return self.raw.decode(self.encoding) + return self.raw.decode(encoding, errors)
@property def content(self):
pywikibot-commits@lists.wikimedia.org