[Git][reproducible-builds/diffoscope][master] Sphinx: better header detection

Chris Lamb (@lamby) gitlab at salsa.debian.org
Mon Jun 1 17:06:34 UTC 2026



Chris Lamb pushed to branch master at Reproducible Builds / diffoscope


Commits:
b800d697 by Jochen Sprickerhof at 2026-06-01T16:32:42+02:00
Sphinx: better header detection

Thanks to Jay Burstin for noticing.

- - - - -


1 changed file:

- diffoscope/comparators/sphinx.py


Changes:

=====================================
diffoscope/comparators/sphinx.py
=====================================
@@ -44,14 +44,16 @@ class SphinxInventoryFile(File):
 def describe_inventory(filename):
     head = b""
     tail = b""
+    in_head = True
 
     with open(filename, "rb") as f:
         for line in f:
-            if line.startswith(b"#"):
+            if in_head and line.startswith(b"#"):
                 # Save commented lines at top of file
                 head += line
             else:
                 # ... save the rest for decompression
+                in_head = False
                 tail += line
 
     result = head + b"\n" if head else b""



View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/b800d697fa3980df1a82cd87b6bd3a67adbc8fc6

-- 
View it on GitLab: https://salsa.debian.org/reproducible-builds/diffoscope/-/commit/b800d697fa3980df1a82cd87b6bd3a67adbc8fc6
You're receiving this email because of your account on salsa.debian.org. Manage all notifications: https://salsa.debian.org/-/profile/notifications | Help: https://salsa.debian.org/help


-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.reproducible-builds.org/pipermail/rb-commits/attachments/20260601/ab51ada7/attachment.htm>


More information about the rb-commits mailing list