From 7ba415f59e60bddb070b13ce31be3f159539094d Mon Sep 17 00:00:00 2001 From: Joe Banks Date: Fri, 21 Jun 2024 16:50:38 +0100 Subject: Skip line if no match against inventory line regex (#3100) --- bot/exts/info/doc/_inventory_parser.py | 7 +++++++ 1 file changed, 7 insertions(+) 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 -- cgit v1.2.3