fix(helpers): make timeline_view and transcribe run on Windows#80
Closed
Pcecil21 wants to merge 9 commits into
Closed
fix(helpers): make timeline_view and transcribe run on Windows#80Pcecil21 wants to merge 9 commits into
Pcecil21 wants to merge 9 commits into
Conversation
Marks the skill as caution-risk to reflect the compliance gate in decisions.md (ElevenLabs Scribe sends audio off-machine; no client PII until John's ADV review). Frontmatter-only; LF endings preserved. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls7GRoTW8Nh4Bm3DKg8TWC
Prevents a Windows editor from re-flipping .md files to CRLF, which produces unreviewable whole-file diffs (the SKILL.md incident). Only governs *.md; existing files are left untouched. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls7GRoTW8Nh4Bm3DKg8TWC
CRLF in a shell script breaks execution on Linux/Codex, which the README markets support for. The existing rule only covered *.md; this extends LF enforcement to executable source. Files are already LF, so renormalize is a no-op — this is preventive hardening. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls7GRoTW8Nh4Bm3DKg8TWC
…tent Supersedes the 2026-04-24 restriction. John approved the ElevenLabs Scribe data flow for full client content, unconditional, verbal. The gate barring client-PII audio from this skill is lifted. Old entry kept intact; lift recorded on top. Open item: capture a written confirmation into the ADV file for the audit trail. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls7GRoTW8Nh4Bm3DKg8TWC
…roval ElevenLabs data flow cleared for full client content (decisions.md 2026-06-19), so the skill is no longer caution-gated. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls7GRoTW8Nh4Bm3DKg8TWC
Three cross-platform bugs surfaced running on a Windows (cp1252) console: 1. UnicodeEncodeError on the '→'/'—' chars in status print() calls — Windows stdout defaults to cp1252 and can't encode them. grade.py crashed before grading; pack_transcripts.py crashed after writing. Fix: force UTF-8 on stdout/stderr at import in the four helpers that print non-ASCII (no-op where already UTF-8). 2. grade.py --analyze passed a Windows temp path into the ffmpeg 'metadata=print:file=...' filter, where ':' and '\' are filtergraph delimiters, so ffmpeg errored out. Fix: pass a bare filename and set ffmpeg's cwd to the file's directory (_metadata_filter_target), so no path ever reaches the filtergraph parser. Adds tests/test_grade_path.py pinning the filter-target invariant. Verified: pack_transcripts and grade --analyze both run clean on Windows with no PYTHONUTF8 workaround. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01Ls7GRoTW8Nh4Bm3DKg8TWC
Completes the Windows-portability sweep across the CLI helpers. Two helpers were never touched by the earlier fixes (cp1252 console + ffmpeg paths): - timeline_view.py: FONT_CANDIDATES listed only macOS/Linux font paths, so on Windows every candidate missed and load_font fell to PIL's default bitmap font (which ignores the requested size), rendering filmstrip labels nearly illegibly. Add %WINDIR%-derived Consolas + Arial candidates (drive-correct, not hardcoded C:). Also force UTF-8 on stdout/stderr so a non-ASCII output path in the status print doesn't raise UnicodeEncodeError on a cp1252 console. - transcribe.py: force UTF-8 on stdout/stderr for the same reason — it prints the video filename, which crashes the helper on Windows if non-ASCII. Adds tests/test_timeline_fonts.py (cross-platform; pins the candidate list, the %WINDIR%-derived font dir, and that load_font never raises). All 7 tests pass on Windows and Linux. No behavior change on macOS/Linux. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com> Claude-Session: https://claude.ai/code/session_01NMuYbKwjCCvuaB6i75DDsF
Author
|
Closing — this PR was accidentally branched off a local main that carried unrelated local files. Reopening a clean PR branched from upstream main with only the intended helper changes. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Motivation / Context
This completes the Windows-portability sweep started in #78 (
cp1252console + ffmpeg path) and #79 (subtitles-filter path escaping). Two CLI helpers were never touched by those fixes and still break on Windows.What's fixed
helpers/timeline_view.pyFONT_CANDIDATESlisted only macOS and Linux font paths. On Windows every candidate failedPath.exists(), soload_fontfell through to PIL's default bitmap font — which ignores the requested size — and the filmstrip labels rendered nearly illegibly. Added%WINDIR%-derived Consolas + Arial candidates (drive-correct, not hardcoded toC:).stdout/stderrso a non-ASCII output path in the status print doesn't raiseUnicodeEncodeErroron a cp1252 console.helpers/transcribe.pystdout/stderrfor the same reason — it prints the video filename, which crashes the helper on Windows when the name is non-ASCII (accents, emoji, CJK).Tests
Adds
tests/test_timeline_fonts.py(cross-platform): pins the candidate list, the%WINDIR%-derived font dir, that the original POSIX candidates are preserved, and thatload_fontnever raises. All 7 tests (new + existing subtitles) pass on Windows and Linux.Risk / caveats
No behavior change on macOS/Linux — the new font paths simply never match there, and the UTF-8 reconfigure is a no-op when the stream is already UTF-8. The
transcribe.pyJSON write was already ASCII-safe (json.dumpsdefaultsensure_ascii=True) and was intentionally left untouched.🤖 Generated with Claude Code
Summary by cubic
Make the CLI helpers run reliably on Windows by fixing console encoding, ffmpeg metadata path parsing, and Windows font selection for timeline labels. Adds tests and small repo hygiene (LF enforcement and
.claude/ignore), plus updates toSKILL.mdand a newdecisions.mdentry recording ElevenLabs approval.timeline_view.py: add Windows font candidates from%WINDIR%\Fonts(Consolas, Arial); force UTF-8 on stdout/stderr to avoid UnicodeEncodeError.transcribe.py: force UTF-8 on stdout/stderr so non-ASCII filenames don’t crash.grade.py: write ffmpeg metadata using cwd + bare filename to avoid:and\in filtergraphs; also force UTF-8 on stdout/stderr.pack_transcripts.py,render.py,transcribe_batch.py: force UTF-8 on stdout/stderr for Windows consoles.tests/test_timeline_fonts.pyandtests/test_grade_path.pyto pin Windows/POSIX behavior.Written for commit 3bc5a03. Summary will update on new commits.