Stirling-Tools/Stirling-PDF · warning · SystemExit

No PDF files found under the supplied --input paths.

Error message

No PDF files found under the supplied --input paths.

What it means

SystemExit raised by harvest_type3_fonts.discover_pdfs when no .pdf files were found under the supplied --input paths. The function resolves each input path, collects files (by .pdf suffix) or recursively globs directories, dedupes, and exits if the result is empty.

Solutions

  1. Verify the input paths contain .pdf files: find <dir> -name '*.pdf'.
  2. Pass explicit PDF file paths if directory globs find nothing.
  3. Confirm the path is accessible and not behind a permission boundary.
Defensive patterns

Strategy: validation

Validate before calling

# Pre-check the input directory contains PDFs
from pathlib import Path
pdfs = list(Path("input_dir").rglob("*.pdf"))
if not pdfs:
    raise SystemExit("No PDF files found under the supplied --input paths.")

Prevention

When it happens

Trigger: Running the script with --input paths that contain no PDFs — nonexistent paths, a directory with no .pdf files, or file inputs that do not end in .pdf.

Common situations: Wrong directory passed to --input. PDFs stored with a different extension. Path typos. Empty corpus directory.

Related errors


AI-assisted analysis of Stirling-Tools/Stirling-PDF@9ef20dcab8 (2026-08-13). Data as JSON: /api/errors/c798596e65bc3159. Report an issue: GitHub.

Appendix: source

Thrown at scripts/harvest_type3_fonts.py:84

        "--pretty",
        action="store_true",
        help="Ask the Java tool to emit pretty-printed JSON (handy for diffs).",
    )
    return parser.parse_args()


def discover_pdfs(paths: Sequence[str]) -> list[Path]:
    pdfs: list[Path] = []
    for raw in paths:
        path = Path(raw).resolve()
        if path.is_file():
            if path.suffix.lower() == ".pdf":
                pdfs.append(path)
        elif path.is_dir():
            pdfs.extend(sorted(path.rglob("*.pdf")))
    unique = sorted(dict.fromkeys(pdfs))
    if not unique:
        raise SystemExit("No PDF files found under the supplied --input paths.")
    return unique


def sanitize_part(part: str) -> str:
    cleaned = re.sub(r"[^A-Za-z0-9._-]+", "_", part)
    return cleaned or "_"


def derive_signature_path(pdf: Path, signatures_dir: Path) -> Path:
    """
    Mirror the PDF path under the signatures directory.
    If the PDF lives outside the repo, fall back to a hashed filename.
    """
    try:
        rel = pdf.relative_to(REPO_ROOT)
    except ValueError:
        digest = hashlib.sha1(str(pdf).encode("utf-8")).hexdigest()[:10]
        rel = Path("__external__") / f"{sanitize_part(pdf.stem)}-{digest}.pdf"

View on GitHub (pinned to 9ef20dcab8)