use bytes regex to avoid string/bytes conflict

pull/446/head
Victor Gambier 2 years ago
parent 3e48fd4fa7
commit a436ea191c

@ -68,8 +68,8 @@ def cleanXML(xml=""):
# for Windows compatibility.
# If the encoding has to stay as is, we'll have
# to change all the file encodings, as well.
if re.search(r"</siteinfo>\n", xml):
if re.search(rb"</siteinfo>\n", xml):
xml = xml.split("</siteinfo>\n")[1].encode("utf-8")
if re.search(r"</mediawiki>", xml):
if re.search(rb"</mediawiki>", xml):
xml = xml.split("</mediawiki>")[0].encode("utf-8")
return xml

Loading…
Cancel
Save