texlive[71597] Build/source/texk/web2c/tests/fix-changefile-lines.py:

commits+ascherer at tug.org commits+ascherer at tug.org
Sun Jun 23 15:57:05 CEST 2024


Revision: 71597
          https://tug.org/svn/texlive?view=revision&revision=71597
Author:   ascherer
Date:     2024-06-23 15:57:04 +0200 (Sun, 23 Jun 2024)
Log Message:
-----------
Catch another exceptional situation.

'WebReader.next_line()' will never set 'tex_line' to 'None' of its own.

In the case that it reaches the end of the '_web_lines' array---say the
change expects more lines after the last line in the original file---,
it returns a single 'None' that gets assigned to the '(p,s,l)' triplet.
However, the 'tex_line' is not changed and still holds the last matching
line from an earlier 'next_line()' (either in the 'for' loop or in the
'while' loop).

We assign 'tex_line = None' when catching the 'TypeError' exception,
because the author of the change file might accidentally duplicate a
line in the '@x.. at y' part of the change hunk.

Modified Paths:
--------------
    trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py

Modified: trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py
===================================================================
--- trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py	2024-06-23 10:29:18 UTC (rev 71596)
+++ trunk/Build/source/texk/web2c/tests/fix-changefile-lines.py	2024-06-23 13:57:04 UTC (rev 71597)
@@ -154,7 +154,10 @@
                 sys.exit(1)
             if tex_line == self._match_lines[0]:
                 for i in range(1, len(self._match_lines)):
-                    _, tex_line = web_reader.next_line()
+                    try:
+                        _, tex_line = web_reader.next_line()
+                    except:
+                        tex_line = None
                     if tex_line is None or tex_line != self._match_lines[i]:
                         eprint("ERROR: Could not match all lines following match line:")
                         eprint(f"  {self._match_lines[0]}")



More information about the tex-live-commits mailing list.