{"record":{"id":"c798596e65bc3159","repo":"Stirling-Tools/Stirling-PDF","slug":"no-pdf-files-found-under-the-supplied-input-path","errorCode":null,"errorMessage":"No PDF files found under the supplied --input paths.","messagePattern":"No PDF files found under the supplied --input paths\\.","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"warning","filePath":"scripts/harvest_type3_fonts.py","lineNumber":84,"sourceCode":"        \"--pretty\",\n        action=\"store_true\",\n        help=\"Ask the Java tool to emit pretty-printed JSON (handy for diffs).\",\n    )\n    return parser.parse_args()\n\n\ndef discover_pdfs(paths: Sequence[str]) -> list[Path]:\n    pdfs: list[Path] = []\n    for raw in paths:\n        path = Path(raw).resolve()\n        if path.is_file():\n            if path.suffix.lower() == \".pdf\":\n                pdfs.append(path)\n        elif path.is_dir():\n            pdfs.extend(sorted(path.rglob(\"*.pdf\")))\n    unique = sorted(dict.fromkeys(pdfs))\n    if not unique:\n        raise SystemExit(\"No PDF files found under the supplied --input paths.\")\n    return unique\n\n\ndef sanitize_part(part: str) -> str:\n    cleaned = re.sub(r\"[^A-Za-z0-9._-]+\", \"_\", part)\n    return cleaned or \"_\"\n\n\ndef derive_signature_path(pdf: Path, signatures_dir: Path) -> Path:\n    \"\"\"\n    Mirror the PDF path under the signatures directory.\n    If the PDF lives outside the repo, fall back to a hashed filename.\n    \"\"\"\n    try:\n        rel = pdf.relative_to(REPO_ROOT)\n    except ValueError:\n        digest = hashlib.sha1(str(pdf).encode(\"utf-8\")).hexdigest()[:10]\n        rel = Path(\"__external__\") / f\"{sanitize_part(pdf.stem)}-{digest}.pdf\"","sourceCodeStart":66,"sourceCodeEnd":102,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/scripts/harvest_type3_fonts.py#L66-L102","documentation":"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.","triggerScenarios":"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.","commonSituations":"Wrong directory passed to --input. PDFs stored with a different extension. Path typos. Empty corpus directory.","solutions":["Verify the input paths contain .pdf files: find <dir> -name '*.pdf'.","Pass explicit PDF file paths if directory globs find nothing.","Confirm the path is accessible and not behind a permission boundary."],"exampleFix":null,"handlingStrategy":"validation","validationCode":"# Pre-check the input directory contains PDFs\nfrom pathlib import Path\npdfs = list(Path(\"input_dir\").rglob(\"*.pdf\"))\nif not pdfs:\n    raise SystemExit(\"No PDF files found under the supplied --input paths.\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Confirm input paths contain .pdf files before running.","Pass explicit PDF file paths if directory globs find nothing.","Verify paths are accessible."],"tags":["cli","scripts","filesystem","validation","python"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}