Maverick has uploaded a new change for review.

  https://gerrit.wikimedia.org/r/189975

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(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/75/189975/1

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):

-- 
To view, visit https://gerrit.wikimedia.org/r/189975
To unsubscribe, visit https://gerrit.wikimedia.org/r/settings

Gerrit-MessageType: newchange
Gerrit-Change-Id: I02609a5abcdf0e5e66bbb4ffdcc41aaf74d5c943
Gerrit-PatchSet: 1
Gerrit-Project: pywikibot/core
Gerrit-Branch: master
Gerrit-Owner: Maverick <[email protected]>

_______________________________________________
MediaWiki-commits mailing list
[email protected]
https://lists.wikimedia.org/mailman/listinfo/mediawiki-commits

Reply via email to