affaan-m/ECC · error · ValueError

clip has no 'path

Error message

clip {i} has no 'path'

What it means

normalise_clips converts a clip list into export-ready normalized entries for FCPXML/EDL building. Each input clip dict must carry a non-empty 'path'. When clip i's path is missing or empty (after str() coercion of c.get('path')), it raises ValueError naming the offending index. Without a path, no asset can be referenced in the timeline export.

Solutions

  1. Ensure every clip dict has a non-empty "path" string before calling build_fcpxml/build_edl
  2. Pre-filter the clips list: drop or fix entries lacking a path, and log them
  3. Check for upstream key renames ('file', 'src', 'location') and map them to 'path'
  4. Fix the data source (spreadsheet/CSV) so path cells are filled

Example fix

// before
clips = [{"duration": 5.0}]
build_fcpxml(clips, fps=24)
// after
clips = [{"path": "/media/a.mov", "duration": 5.0}]
build_fcpxml(clips, fps=24)
Defensive patterns

Strategy: validation

Validate before calling

def clips_have_paths(clips: list[dict]) -> list[int]:
    return [i for i, c in enumerate(clips) if not str(c.get("path") or "").strip()]

Type guard

def has_path(clip) -> bool:
    return bool(str(clip.get("path") or "").strip())

Try / catch

try:
    xml = build_fcpxml(clips, fps=24)
except ValueError as e:
    if "has no 'path'" in str(e):
        idx = int(e.args[0].split()[1])
        print(f"clip {idx} missing path; fix input data")
    raise

Prevention

When it happens

Trigger: Calling build_fcpxml or build_edl with a clips list where some entry has no 'path' key, path=None, or path="" — e.g. a script generating clips from a spreadsheet with blank rows.

Common situations: Hand-assembled clip lists, CSV/JSON imports with missing cells, clips constructed programmatically with only name/duration, or keys renamed upstream (e.g. 'file' instead of 'path').

Understand the failure class

Background: "missing required argument" and "the following required arguments were not provided": what required-argument errors mean and how to fix them — this error's family across 20 libraries.

Related errors


AI-assisted analysis of affaan-m/ECC@8321021c54 (2026-09-16). Data as JSON: /api/errors/ede30081c7127ca3. Report an issue: GitHub.

Appendix: source

Thrown at skills/taste-application/scripts/tasteforge/export.py:54

    "write_timeline",
]


# ---------------------------------------------------------------------------
# clip normalisation
# ---------------------------------------------------------------------------

def normalise_clips(clips: Iterable[dict], fps: float | Fraction) -> list[dict]:
    """Validate clips and pre-compute integer frame counts and offsets.

    Each clip is ``{"path": str, "duration": float, "name": str?}``.
    """
    out: list[dict] = []
    offset = 0
    for i, c in enumerate(clips):
        path = str(c.get("path") or "")
        if not path:
            raise ValueError(f"clip {i} has no 'path'")
        dur = float(c.get("duration") or 0.0)
        if dur <= 0:
            raise ValueError(f"clip {i} ({path}) has non-positive duration {dur!r}")
        frames = max(1, seconds_to_frames(dur, fps))  # never a zero-length event
        name = str(c.get("name") or Path(path).stem)
        out.append(
            {
                "path": path,
                "name": name,
                "frames": frames,
                "offset_frames": offset,
                "seconds": dur,
            }
        )
        offset += frames
    if not out:
        raise ValueError("no clips to write - a timeline needs at least one event")
    return out

View on GitHub (pinned to 8321021c54)