Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

ZeroDivisionError: float division by zero #202

Closed
shibumi opened this issue Oct 22, 2017 · 6 comments
Closed

ZeroDivisionError: float division by zero #202

shibumi opened this issue Oct 22, 2017 · 6 comments
Assignees
Labels
Bug Generic bug: can be used together with more specific labels
Milestone

Comments

@shibumi
Copy link

shibumi commented Oct 22, 2017

Hello while ripping I got this error:

Ripping track 13 of 15: 13. ギルガメッシュ - smash!!.flac
WARNING:morituri.program.cdparanoia:file size 0 did not match expected size 31695596
WARNING:morituri.program.cdparanoia:non-integral amount of frames difference
Traceback (most recent call last):         
  File "/usr/lib/python2.7/site-packages/morituri/extern/task/task.py", line 511, in c
    callable(*args, **kwargs)
  File "/usr/lib/python2.7/site-packages/morituri/program/cdparanoia.py", line 316, in _read
    self._done()
  File "/usr/lib/python2.7/site-packages/morituri/program/cdparanoia.py", line 390, in _done
    self.quality = self._parser.getTrackQuality()
  File "/usr/lib/python2.7/site-packages/morituri/program/cdparanoia.py", line 201, in getTrackQuality
    return min(frames * 2.0 / reads, 1.0)
ZeroDivisionError: float division by zero

I ripped the following CD: https://musicbrainz.org/cdtoc/attach?toc=1+15+207849+150+5169+20758+33837+47664+61612+79296+85118+97961+111683+127452+143271+158135+171611+189951&tracks=15&id=q6de1TGfhajKLUYfGFUtRxYn9VI-

@nicksinger
Copy link

Are you sure you're on the most recent version of whipper? #159 fixed at least the hard crash here.
However I'd be interesting to know if your drive works properly because this happens if nothing could be read off the CD (reads == 0, therefore a division by zero). I encountered this error with a faulty CD drive.

Could you try the plain old cdparanoia to rip the same disk with the same drive again? Because if this works, the problem is maybe more deeply hidden in whipper.

@shibumi
Copy link
Author

shibumi commented Nov 18, 2017

Yep I am on version 0.5.1 (your last official release). The funny part is that I can still rip the CD without any broken song. whipper will just rip the song again and then it suddenly works. The accuraterip database entry looks also good for that CD.

I don't think the CD drive is broken. It's new and just a couple of days old. I ordered it explicitly for the use with whipper.

Where can I find the plain old cdparanoia?

@JoeLametta JoeLametta added the Bug Generic bug: can be used together with more specific labels label Jan 26, 2018
@JoeLametta JoeLametta added this to the 1.0 milestone Apr 6, 2018
@JoeLametta
Copy link
Collaborator

@shibumi Whipper v0.6.0 has the commit linked in #159: that exception shouldn't raise anymore.

I'm keeping this issue open because, before closing it, I'd like to be sure we're not ignoring a deeper problem in whipper.

@JoeLametta JoeLametta self-assigned this Nov 3, 2018
@JoeLametta
Copy link
Collaborator

Old discussion is available in thomasvs/morituri#46.
I think I'm going to revert this change because it doesn't seem related to hardware issues and may mask other existing problems too.

@shibumi
Copy link
Author

shibumi commented Nov 4, 2018

@JoeLametta shall I rip the CD and check if the error still exist?

@JoeLametta
Copy link
Collaborator

@JoeLametta shall I rip the CD and check if the error still exist?

Right now that exception won't raise because the instruction that may cause a division by zero is wrapped in a try [...] except [...] but I don't exclude a test could be useful, in the near future, after we've reverted that commit. Thanks.

@JoeLametta JoeLametta added the Status: in progress Issue/pull request which is currently being worked on label Nov 9, 2018
@JoeLametta JoeLametta added completed and removed Status: in progress Issue/pull request which is currently being worked on labels Nov 9, 2018
JoeLametta added a commit that referenced this issue Nov 9, 2018
This commit effectively reverts #159. Whipper now raises an exception again but with a clearer textual description.

Closes #202.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Bug Generic bug: can be used together with more specific labels
Projects
None yet
Development

No branches or pull requests

3 participants