{"record":{"id":"32d169e7a9973744","repo":"affaan-m/ECC","slug":"unknown-timeline-format-fmt-r-use-fcpxml-or-edl","errorCode":null,"errorMessage":"unknown timeline format {fmt!r} - use 'fcpxml' or 'edl'","messagePattern":"unknown timeline format (.+?) - use 'fcpxml' or 'edl'","errorType":"validation","errorClass":"ValueError","httpStatus":null,"severity":"error","filePath":"skills/taste-application/scripts/taste/timeline.py","lineNumber":449,"sourceCode":"    fps: float,\n    out_path: str | Path,\n    fmt: str = \"fcpxml\",\n    title: str | None = None,\n    width: int = 1920,\n    height: int = 1080,\n) -> Path:\n    \"\"\"Write ``clips`` to ``out_path`` as ``fcpxml`` or ``edl``. Returns the path.\"\"\"\n    out_path = Path(out_path)\n    out_path.parent.mkdir(parents=True, exist_ok=True)\n    name = title or out_path.stem\n\n    fmt = fmt.lower().lstrip(\".\")\n    if fmt == \"fcpxml\":\n        text = build_fcpxml(clips, fps=fps, title=name, width=width, height=height)\n    elif fmt == \"edl\":\n        text = build_edl(clips, fps=fps, title=name)\n    else:\n        raise ValueError(f\"unknown timeline format {fmt!r} - use 'fcpxml' or 'edl'\")\n\n    out_path.write_text(text, encoding=\"utf-8\")\n    return out_path\n\n\n# ---------------------------------------------------------------------------\n# self-check\n# ---------------------------------------------------------------------------\n\nif __name__ == \"__main__\":\n    import tempfile\n\n    # --- rational arithmetic, the part that breaks imports when wrong --------\n    assert fps_fraction(29.97) == Fraction(30000, 1001)\n    assert fps_fraction(23.976) == Fraction(24000, 1001)\n    assert fps_fraction(24) == Fraction(24, 1)\n    assert frames_to_rational(1, 29.97) == \"1001/30000s\", frames_to_rational(1, 29.97)\n    assert frames_to_rational(0, 24) == \"0s\"","sourceCodeStart":431,"sourceCodeEnd":467,"githubUrl":"https://github.com/affaan-m/ECC/blob/8321021c54d670126ce3b2969d5deb880b4b0c2a/skills/taste-application/scripts/taste/timeline.py#L431-L467","documentation":"timeline.py raises ValueError('unknown timeline format {fmt!r} - use fcpxml or edl') in write_timeline when the fmt argument (after lowercasing and stripping a leading dot) is not 'fcpxml' or 'edl'. The writer supports exactly two output formats.","triggerScenarios":"Calling write_timeline with fmt like 'xml', 'fcp', '.FCPXML' handled okay but 'premiere', 'fcpxml.txt', or a mistyped string; fmt=None coerced by str() elsewhere; passing an extension with extra characters.","commonSituations":"User config specifying a format name not in the supported pair; passing a filename where the format string was expected; case variants handled, but hyphenated variants ('fcp-xml') are not.","solutions":["Pass fmt='fcpxml' or fmt='edl' exactly.","Strip any accidental suffix/whitespace: fmt.strip().lower().lstrip('.') before calling.","Derive fmt from the output file extension only if it maps to one of the two supported values.","Update config to use a supported format name."],"exampleFix":"// before\nwrite_timeline(clips, out, fmt='premiere')\n// after\nwrite_timeline(clips, out, fmt='fcpxml')  # or 'edl'","handlingStrategy":"validation","validationCode":"ALLOWED_FORMATS = {'fcpxml', 'edl'}\ndef validate_format(fmt):\n    f = str(fmt).lower().lstrip('.').strip()\n    if f not in ALLOWED_FORMATS:\n        raise ValueError(f\"unknown timeline format {fmt!r} - use 'fcpxml' or 'edl'\")\n    return f","typeGuard":"def is_supported_format(fmt) -> bool:\n    return str(fmt).lower().lstrip('.').strip() in {'fcpxml', 'edl'}","tryCatchPattern":"try:\n    write_timeline(clips, out, fmt=fmt)\nexcept ValueError as e:\n    if 'unknown timeline format' in str(e):\n        logger.error('unsupported format %r; defaulting to fcpxml', fmt)\n        write_timeline(clips, out, fmt='fcpxml')","preventionTips":["Restrict format options in configs/UI to 'fcpxml' and 'edl'","Normalize format strings (lower, strip leading dot) at input boundaries","Map friendly names ('xml' -> 'fcpxml') before calling the writer","Document supported formats where users edit configuration"],"tags":["validation","timeline","argument"],"backgroundTag":"invalid-enum-value","analyzedSha":"8321021c54d670126ce3b2969d5deb880b4b0c2a","analyzedAt":"2026-09-16T10:08:13.343Z","contentChangedAt":"2026-09-16T10:08:13.343Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}