Skip to content

Don't crash writing the log when a track was skipped#694

Open
mkoester wants to merge 1 commit into
whipper-team:developfrom
mkoester:fix/log-skipped-track-peak-none
Open

Don't crash writing the log when a track was skipped#694
mkoester wants to merge 1 commit into
whipper-team:developfrom
mkoester:fix/log-skipped-track-peak-none

Conversation

@mkoester

Copy link
Copy Markdown

A track that fails every rip attempt is marked skipped and never gets a
peak level, leaving trackResult.peak as None. writeLog() -> trackLog()
then did an unconditional trackResult.peak / 32768.0, raising
TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'
and aborting the whole run after every other track had ripped fine, so
no log or cue file was written.

This is easy to hit on enhanced/CD-Extra discs: the last audio track
(right before the trailing data track) often fails to read, gets skipped
with -k, and then takes the log-writer down.

Guard the peak line so the "Peak level" entry is simply omitted for a
track without a peak, matching cd.py which already avoids the same
division for skipped tracks. Add a regression test covering a rip that
contains a skipped track.

Co-Authored-By: Claude Opus 4.8 noreply@anthropic.com

@github-actions github-actions Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

💖 Thanks for opening your first pull request here! 💖

A track that fails every rip attempt is marked skipped and never gets a
peak level, leaving trackResult.peak as None. writeLog() -> trackLog()
then did an unconditional `trackResult.peak / 32768.0`, raising
`TypeError: unsupported operand type(s) for /: 'NoneType' and 'float'`
and aborting the whole run *after* every other track had ripped fine, so
no log or cue file was written.

This is easy to hit on enhanced/CD-Extra discs: the last audio track
(right before the trailing data track) often fails to read, gets skipped
with -k, and then takes the log-writer down.

Guard the peak line so the "Peak level" entry is simply omitted for a
track without a peak, matching cd.py which already avoids the same
division for skipped tracks. Add a regression test covering a rip that
contains a skipped track.

Co-Authored-By: Claude Opus 4.8 <noreply@anthropic.com>
Signed-off-by: Mirko Köster <git@mirkokoester.de>
@mkoester
mkoester force-pushed the fix/log-skipped-track-peak-none branch from 32f2b3d to 27bca97 Compare July 20, 2026 15:19
@mkoester
mkoester marked this pull request as ready for review July 20, 2026 15:20
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.

1 participant