Replace urlencoded chars with unicode equivalent

Otherwise we get value errors while marking since pwb replaces those

Related Task: [FS#160](https://fs.golderweb.de/index.php?do=details&task_id=160)
This commit is contained in:
2017-10-28 22:35:25 +02:00
parent 7e0456ae4f
commit 5f4640d5ff

View File

@@ -28,6 +28,7 @@ Provides classes for working with RedFams
import hashlib import hashlib
import locale import locale
import re import re
import urllib.parse
from datetime import datetime from datetime import datetime
import mwparserfromhell as mwparser # noqa import mwparserfromhell as mwparser # noqa
@@ -291,6 +292,9 @@ class RedFamParser( RedFam ):
# Make sure first letter is uppercase # Make sure first letter is uppercase
article = article[0].upper() + article[1:] article = article[0].upper() + article[1:]
# Unquote possible url encoded special chars
article = urllib.parse.unquote( article )
# Split in title and anchor part # Split in title and anchor part
article = article.split("#", 1) article = article.split("#", 1)
# Replace underscores in title with spaces # Replace underscores in title with spaces