nexu-io/open-design · error · FileNotFoundError

source not found: {path}

Error message

source not found: {path}

What it means

Raised by read_source in humanize_ppt_v2.py as `raise FileNotFoundError(...)` when the path passed via --source does not exist on disk after expanduser(). This is the brief-mode entry guard: before any parsing, the file must be reachable. The path in the message is the expanded Path object, so '~' shortcuts are resolved for clarity.

Source

Thrown at plugins/community/humanize-ppt/scripts/humanize_ppt_v2.py:199

        return None
    if force or any((out / marker).exists() for marker in HUMANIZE_OUT_MARKERS):
        shutil.rmtree(out)
        out.mkdir(parents=True, exist_ok=True)
        return None
    marker_list = " or ".join(HUMANIZE_OUT_MARKERS)
    return (
        f"--out {out} already exists, is not empty, and does not look like a "
        f"previous Humanize PPT run (no {marker_list} "
        "at its root). Refusing to wipe it: it may hold content you did not intend "
        "to lose. Point --out at a dedicated run directory, or pass --force to wipe "
        "it anyway.\n"
    )


def read_source(source):
    path = Path(source).expanduser()
    if not path.exists():
        raise FileNotFoundError(f"source not found: {path}")
    if path.suffix.lower() in {".ppt", ".pptx"}:
        raise ValueError(
            f"brief mode reads markdown/text raw material, not rendered decks: {path}. "
            "Extract the text first (see scripts/pptx_qa.py's dump/inspect output for an "
            "existing .ppt/.pptx) and pass that as --source. If this is a deck Humanize "
            "PPT already rendered, run the presentation checkup instead: "
            "--qa-from <path-to-this-file.pptx>."
        )
    text = path.read_text(encoding="utf-8", errors="replace")
    return path, text, markdown_segments(text)


def strip_md(line):
    line = re.sub(r"^#{1,6}\s*", "", line.strip())
    line = re.sub(r"^[-*+]\s+", "", line)
    line = re.sub(r"^\d+[.)]\s+", "", line)
    line = re.sub(r"[`*_>\[\]]", "", line)
    return line.strip()

View on GitHub (pinned to 5be4028344)

Solutions

  1. Verify the file exists and is readable from the exact cwd the script runs in: `ls -la <path>` and `python3 -c "from pathlib import Path; print(Path('<path>').expanduser().exists())"`.
  2. Use an absolute path to remove cwd ambiguity, or `cd` to the directory containing the source first.
  3. If using '~', confirm `$HOME` is set correctly (`echo $HOME`) — common in Docker/CI where HOME is unset.
  4. Regenerate/redownload the source file if it was supposed to be produced by an upstream step that silently failed.

Example fix

// before
python3 humanize_ppt_v2.py --source ./notes.md
# -> FileNotFoundError: source not found: notes.md

// after
python3 humanize_ppt_v2.py --source /absolute/path/to/notes.md
# verify first
python3 -c "from pathlib import Path; print(Path('/absolute/path/to/notes.md').exists())"
Defensive patterns

Strategy: validation

Validate before calling

from pathlib import Path

source_path = Path(args.source).expanduser()
if not source_path.exists():
    raise SystemExit(f"source not found: {source_path}. Check the path and cwd.")
# safe to pass to read_source

Try / catch

try:
    path, text, segments = read_source(args.source)
except FileNotFoundError as exc:
    raise SystemExit(f"Could not open source: {exc}") from exc

Prevention

When it happens

Trigger: Launching humanize PPT brief mode with `--source <path>` where path is missing, mistyped, relative to the wrong cwd, points to a remote/URL (not fetched), or uses a '~' that expanduser cannot resolve (e.g. wrong HOME in CI). Also fires for broken symlinks (exists() returns False).

Common situations: Typo in the source path; running the script from a different working directory than expected; CI/agent passing a path that was never materialized; symlink to a network mount that is offline; permissions issue masked as missing (rare — exists() also returns False on broken symlinks).

Related errors


AI-assisted analysis of nexu-io/open-design@5be4028344 (2026-08-12). Data as JSON: /api/errors/fabf6d8dc70bfe76. Report an issue: GitHub.