fix(verify-layout): name both causes of a broken bounding-box extractor (#451) (#465)

verify_layout.py's skipped: message blamed only the xpdf-based pdftotext that
Git for Windows puts ahead of Poppler in PATH. A real Poppler can abort too:
26.0x before 26.05 crashes -bbox/-bbox-layout/-htmlmeta on a PDF whose Info
dictionary carries an empty string in any field, and hyperref writes exactly
that for every field it does not set. A lualatex/pdflatex document built with
hyperref and no \hypersetup{pdftitle=...} - an ordinary /add-template CV
template, not a malformed one - hits this with a working Poppler installed,
and the old message sent the reader to check their PATH when nothing was
wrong with it.

Named both causes in the raised message, the code comment above it, and the
module docstring. Behavior is unchanged: either cause still degrades to
skipped: exit 2, not exit 1, since a broken extractor is still not a broken
document.

Added test_poppler_abort_on_empty_info_string_names_that_cause_too, mocking
subprocess.run to raise CalledProcessError the way a real Poppler 26.0x abort
does (exit 1, a libc++abi out_of_range trace on stderr) rather than the
xpdf case's exit 99 - the two failures are the same exception type with
different exit codes and stderr text, so the message has to actually
distinguish them, not just catch the one class. Negative control: this test
fails against the pre-fix message with "'Poppler aborted' not found in
'...a pdftotext without -bbox is usually the xpdf build...'".

Thanks to @main-sounds-audio for the report and the isolated repro (which
field, which Poppler modes, five runs of five) that pinned this to Poppler's
own upstream regression (issue #1699, fixed in 26.05.0) rather than an
extraction-library swap.

Fixes #451
This commit is contained in:
Souptik Chakraborty
2026-09-16 06:43:20 +02:00
committed by GitHub
parent 88d1b61047
commit 1b65f7198a
3 changed files with 54 additions and 7 deletions
+12
View File
@@ -55,6 +55,18 @@ per-file diff commands.
### Fixed
- **`tools/verify_layout.py`'s `skipped:` message named only one cause of a broken
extractor when there are two** (#451) - it blamed the xpdf-based `pdftotext` Git for
Windows puts ahead of Poppler in PATH (no `-bbox` flag, exits 99), but a real Poppler
can abort `-bbox`/`-bbox-layout`/`-htmlmeta` too: Poppler 26.0x before 26.05 crashes on
any PDF whose Info dictionary carries an empty string in any field, and `hyperref`
writes exactly that for every field it does not set. A `lualatex`/`pdflatex` document
built with `hyperref` and no `\hypersetup{pdftitle=...}` - an ordinary `/add-template`
CV template, not a malformed one - hits this with a working Poppler installed, and the
old message sent the reader to check their PATH when nothing was wrong with it. The
message now names both causes; behavior is unchanged, degrading to `skipped:` exit 2
either way, since a broken extractor is still not a broken document.
- **The template-placeholder guard in `test_setup_command.py` now skips on forks** (#463) -
`TemplatesStillCarryThePlaceholders` asserts that `05-cv-templates.md` and
`06-cover-letter-templates.md` still contain `[FIRST_NAME]`, `[LAST_NAME]`, `[YOUR_EMAIL]`,