Skip to content
Snippets Groups Projects
Commit 6eb56487 authored by Chris Lamb's avatar Chris Lamb :eyes:
Browse files

Even if a Sphinx .inv inventory file is labelled "The remainder of this file...

Even if a Sphinx .inv inventory file is labelled "The remainder of this file is compressed using zlib.", it might not actually be. In this case, don't traceback and simply return the original content. (Closes: #299)
parent 72300cb0
No related branches found
No related tags found
No related merge requests found
Pipeline #335252 passed with warnings
......@@ -55,6 +55,13 @@ def describe_inventory(filename):
tail += line
result = head + b"\n" if head else b""
result += zlib.decompress(tail)
return result.decode("utf-8")
try:
result += zlib.decompress(tail)
except zlib.error:
# Even if the file is labelled "The remainder of this file is
# compressed using zlib.", it might not actually be. In this case,
# simply return the original content.
result += tail
return result.decode("utf-8", "ignore")
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment