Skip to content

Commit

Permalink
fixup! wikipedia: fix unreliable urlparse() usage
Browse files Browse the repository at this point in the history
use group(0)
  • Loading branch information
SnoopJ committed Nov 30, 2023
1 parent eb829a3 commit 5ac0c1e
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion sopel/builtins/wikipedia.py
Original file line number Diff line number Diff line change
Expand Up @@ -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/")
Expand Down

0 comments on commit 5ac0c1e

Please sign in to comment.