From 5ac0c1e1b54f36293ef6134c11a51d2cbb00de5c Mon Sep 17 00:00:00 2001 From: James Gerity Date: Wed, 29 Nov 2023 19:18:46 -0500 Subject: [PATCH] fixup! wikipedia: fix unreliable urlparse() usage use group(0) --- sopel/builtins/wikipedia.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/sopel/builtins/wikipedia.py b/sopel/builtins/wikipedia.py index 1c8c13bc8..e90402d9b 100644 --- a/sopel/builtins/wikipedia.py +++ b/sopel/builtins/wikipedia.py @@ -327,7 +327,7 @@ def mw_image_description(server, image): def mw_info(bot, trigger, match=None): """Retrieves and outputs a snippet of the linked page.""" server = match.group(1) - page_info = urlparse(match.match.string) + page_info = urlparse(match.group(0)) # in Python 3.9+ this can be str.removeprefix() instead, but we're confident that # "/wiki/" is at the start of the path anyway since it's part of the pattern trim_offset = len("/wiki/")