From 0e37e0524b2628b44b216d6a0c03223fa597da56 Mon Sep 17 00:00:00 2001 From: Kumi Date: Tue, 16 Jul 2024 10:18:44 +0200 Subject: [PATCH] fix(wiki-article): correct URL escaping issue Switched to single quotes for the title replacement in the URL to ensure compatibility with older Python versions. --- src/wikimore/app.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/wikimore/app.py b/src/wikimore/app.py index 5519a7c..233b2dc 100644 --- a/src/wikimore/app.py +++ b/src/wikimore/app.py @@ -112,7 +112,7 @@ def wiki_article(project, lang, title): logger.debug(f"Fetching {title} from {base_url}") - url = f"{base_url}/w/api.php?action=query&format=json&titles={escape(title.replace(" ", "_"), True)}&prop=revisions&rvprop=content&rvparse=1" + url = f"{base_url}/w/api.php?action=query&format=json&titles={escape(title.replace(' ', '_'), True)}&prop=revisions&rvprop=content&rvparse=1" with urllib.request.urlopen(url) as response: data = json.loads(response.read().decode()) pages = data["query"]["pages"]