Skip to content

Fix missing sys import and stale clips.txt accumulation#8

Open
patrickrconnor wants to merge 1 commit into
CalNightingale:masterfrom
patrickrconnor:fix/sys-import-and-clips-truncate
Open

Fix missing sys import and stale clips.txt accumulation#8
patrickrconnor wants to merge 1 commit into
CalNightingale:masterfrom
patrickrconnor:fix/sys-import-and-clips-truncate

Conversation

@patrickrconnor

@patrickrconnor patrickrconnor commented May 8, 2026

Copy link
Copy Markdown

Summary

Two small bug fixes for latent failure modes in the splice pipeline:

  • Add import sys to splice.py. sys.exit(...) is called in two places — the disk-space guard in spliceFilm (splice.py:203) and the cancel path in prompt_name (splice.py:347) — but sys was never imported, so either path would NameError instead of exiting cleanly.
  • Change >> to > in splice.sh. The clip-list build appended to clips.txt in the repo root before mv-ing it into staging/. If a previous run died between the redirect and the mv (Ctrl-C, ffmpeg crash, etc.), the stale file in the repo root would accumulate entries on the next run, producing a malformed concat manifest. Truncating with > makes each run start clean.

No behavior change on the happy path.

Test plan

  • Run a normal new splice end-to-end and confirm splice + upload still work.
  • (Optional) Trigger the disk-space branch with a tiny free-space limit to confirm it now exits cleanly instead of NameError.
  • (Optional) Manually create a stale clips.txt in the repo root, run a splice, confirm the resulting staging/clips.txt only contains the current run's entries.

- Add `import sys` so the `sys.exit` calls in spliceFilm (disk-space
  guard) and prompt_name (cancel path) don't NameError when triggered.
- Change `>>` to `>` in splice.sh so a leftover clips.txt in the repo
  root from a prior crashed run doesn't accumulate into the next
  ffmpeg concat list.

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>

@CalNightingale CalNightingale left a comment

Copy link
Copy Markdown
Owner

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM - thanks patty for the improvements

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants