Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
It is a safer alternative to reduce(lambda x, y: x + y[0] * y[1] / total, parts, 0.0) expression which was requiring a separated calculation of total, prone to errors.
- Loading branch information
Showing
1 changed file
with
21 additions
and
0 deletions.
There are no files selected for viewing
This file contains 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
ab9fbd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I have been getting a divide by zero error when doing "Lookup" on a cluster during the phase where the found release is returned. The entry shows on the screen as "[loading Album Information]". Once this happens, I have to exit and re-start because nothing works. After re-starting, looking up the same cluster works perfectly.
I made an ad-hoc modification to check the value of
total
before using it in the division expression on line 347. I have no idea if this is a good thing to do but, since I did it, there have been no divide-by-zero errors.I don't know what the correct way to raise this is.
My replacement line is
ab9fbd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@johnlane : can you provide debug output (-d option) on a bug report on http://tickets.musicbrainz.org/browse/PICARD ?
Please post the full exception message too.
ab9fbd7
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zas I have opened a ticket http://tickets.musicbrainz.org/browse/PICARD-630. I will update that ticket with the details you've requested (as soon as the problem recurs, probably tomorrow now...)