XZise has uploaded a new change for review.

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

Change subject: [FIX] site_detect: Supply convert_charrefs
......................................................................

[FIX] site_detect: Supply convert_charrefs

With Python version 3.4, HTMLParser supports the `convert_charref` argument
which is by default since 3.5.

Bug: T108670
Change-Id: I381d038e7cb3461afd196b19e549f324c4e1054d
---
M pywikibot/site_detect.py
1 file changed, 6 insertions(+), 3 deletions(-)


  git pull ssh://gerrit.wikimedia.org:29418/pywikibot/core 
refs/changes/73/232473/1

diff --git a/pywikibot/site_detect.py b/pywikibot/site_detect.py
index fed47e9..0e6634c 100644
--- a/pywikibot/site_detect.py
+++ b/pywikibot/site_detect.py
@@ -17,7 +17,7 @@
 from collections import defaultdict
 from distutils.version import LooseVersion as V
 
-from pywikibot.tools import PY2
+from pywikibot.tools import PY2, PYTHON_VERSION
 
 if not PY2:
     from html.parser import HTMLParser
@@ -150,8 +150,11 @@
 
     """Wiki HTML page parser."""
 
-    def __init__(self, *args, **kwargs):
-        HTMLParser.__init__(self, *args, **kwargs)
+    def __init__(self):
+        if PYTHON_VERSION < (3, 4):
+            HTMLParser.__init__(self)
+        else:
+            super().__init__(convert_charrefs=True)
         self.generator = None
 
     def handle_starttag(self, tag, attrs):

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

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

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

Reply via email to