{"record":{"id":"1fca46f3e5b659ac","repo":"Stirling-Tools/Stirling-PDF","slug":"input-directory-not-found-input-dir","errorCode":null,"errorMessage":"Input directory not found: {input_dir}","messagePattern":"Input directory not found: (.+?)","errorType":"exception","errorClass":"SystemExit","httpStatus":null,"severity":"error","filePath":"scripts/summarize_type3_signatures.py","lineNumber":87,"sourceCode":"        lines.append(\"| --- | --- | --- | --- |\")\n        for entry in entries:\n            signature = entry.get(\"signature\") or \"—\"\n            sample = Path(entry[\"source\"]).name\n            glyph_count = entry.get(\"glyphCount\") if entry.get(\"glyphCount\") is not None else \"—\"\n            coverage = entry.get(\"glyphCoverage\") or []\n            preview = \", \".join(str(code) for code in coverage[:10])\n            lines.append(f\"| `{signature}` | `{sample}` | {glyph_count} | {preview} |\")\n        lines.append(\"\")\n\n    output.parent.mkdir(parents=True, exist_ok=True)\n    output.write_text(\"\\n\".join(lines), encoding=\"utf-8\")\n\n\ndef main() -> None:\n    args = parse_args()\n    input_dir = Path(args.input)\n    if not input_dir.exists():\n        raise SystemExit(f\"Input directory not found: {input_dir}\")\n    inventory = load_signatures(input_dir)\n    output_path = Path(args.output)\n    write_markdown(inventory, output_path, input_dir)\n    print(f\"Wrote inventory for {len(inventory)} aliases to {output_path}\")\n\n\nif __name__ == \"__main__\":\n    main()\n","sourceCodeStart":69,"sourceCodeEnd":96,"githubUrl":"https://github.com/Stirling-Tools/Stirling-PDF/blob/9ef20dcab80b85041912f045e17a6aea1d08f969/scripts/summarize_type3_signatures.py#L69-L96","documentation":"summarize_type3_signatures.py reads captured Type3 signature JSON dumps from a directory (default docs/type3/signatures) and writes a Markdown inventory. It checks input_dir.exists() at line 86 and exits with this message if the path is missing before globbing. The path comes from --input and is resolved relative to the current working directory. A missing directory almost always means signatures have not been captured yet or the script was invoked from the wrong cwd.","triggerScenarios":"Running the script before any Type3 signature extraction has populated docs/type3/signatures; passing a --input path that is misspelled or relative to a different cwd; the directory was cleaned or is gitignored and never created.","commonSituations":"Fresh checkout where signature capture hasn't run; invoking from a subdirectory so the relative default path doesn't resolve; CI running on a minimal checkout that excludes docs/.","solutions":["Confirm the directory exists: `ls <input_dir>`","Run the upstream signature-capture step first so the directory is populated with *.json dumps","Pass an absolute path with `--input /abs/path` to remove cwd ambiguity"],"exampleFix":"# before -- run before capturing anything\npython scripts/summarize_type3_signatures.py --input docs/type3/signatures\n# (fails: directory does not exist)\n\n# after -- populate first, then summarize from repo root\npython scripts/extract_type3_signatures.py docs/sample.pdf --out docs/type3/signatures\npython scripts/summarize_type3_signatures.py --input docs/type3/signatures","handlingStrategy":"validation","validationCode":"from pathlib import Path\n\ninput_dir = Path(args.input)\nif not input_dir.is_dir():\n    raise SystemExit(f\"Input directory not found: {input_dir}\")","typeGuard":null,"tryCatchPattern":null,"preventionTips":["Run the script from the repo root so the relative default path resolves","Populate the directory via the signature-capture step before summarizing","Pass an absolute --input path in CI to avoid cwd sensitivity"],"tags":["cli","argparse","filesystem","path"],"backgroundTag":null,"analyzedSha":"9ef20dcab80b85041912f045e17a6aea1d08f969","analyzedAt":"2026-08-13T22:11:39.827Z","schemaVersion":2},"datasetVersion":"2026-08-14T00:17:13.853Z"}