aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorGravatar Joe Banks <[email protected]>2024-06-21 16:50:38 +0100
committerGravatar GitHub <[email protected]>2024-06-21 16:50:38 +0100
commit7ba415f59e60bddb070b13ce31be3f159539094d (patch)
treece4dc3cbdbe07816e4c0faeaa7df5329efb1cd1c
parentBump urllib3 from 2.2.1 to 2.2.2 in the pip group (#3097) (diff)
Skip line if no match against inventory line regex (#3100)
-rw-r--r--bot/exts/info/doc/_inventory_parser.py7
1 files changed, 7 insertions, 0 deletions
diff --git a/bot/exts/info/doc/_inventory_parser.py b/bot/exts/info/doc/_inventory_parser.py
index 4bfd5c919..33964be99 100644
--- a/bot/exts/info/doc/_inventory_parser.py
+++ b/bot/exts/info/doc/_inventory_parser.py
@@ -69,6 +69,13 @@ async def _load_v2(stream: aiohttp.StreamReader) -> InventoryDict:
async for line in ZlibStreamReader(stream):
m = _V2_LINE_RE.match(line.rstrip())
+
+ # If we don't have a match, the package is probably doing something
+ # funky with new-lines and we can discount this line, it's likely a
+ # multi-line figure description or something similar.
+ if not m:
+ continue
+
name, type_, _prio, location, _dispname = m.groups() # ignore the parsed items we don't need
if location.endswith("$"):
location = location[:-1] + name