-
Notifications
You must be signed in to change notification settings - Fork 19
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
Unhandled StopIteration exception #36
Comments
@mcrute, I actually meant to log this issue in the Mopidy-Pandora project (too many browser tabs open) - which is why the stack trace references that code base. ...but I'm also uncertain as to what may cause this error as it looked to me like |
I tried to reproduce this but haven't had much luck, do you know what conditions this happens under? I tried a fake test and the only way I was able to reproduce the issues was if the wrapped function throws a Your Mopidy-Pandora code looks correct as far as I can tell. |
I noticed that the exception is also handled in Lines 96 to 100 in 264130b
When listening to some obscure artist using the iPhone or browser player, it has happened to me that Pandora would display a message saying that it does not have any more tracks for that station, and redirect to the main screen. Perhaps it is possible that the array returned by From looking at https://github.com/PromyLOPh/pianobar/blob/7235a62c183d3815a0fc3dd7e05c6a3492a23f1f/src/libpiano/response.c#L87-L117 and https://github.com/PromyLOPh/pianobar/blob/7235a62c183d3815a0fc3dd7e05c6a3492a23f1f/src/libpiano/response.c#L223-L265 it seems that pianobar has a whole bunch of additional safeguards to check for null values, perhaps just for situations such as this? |
In my fake test I did try to return an empty list and I don't remember why I added the retry to the mpg123 player, it may well have been to fix this issue. |
Another difference may be that pydora uses Either way, won't it make more sense for pydora to raise its own custom exception when no more tracks are being returned by I'm away from my keyboard for a short break so just speculating, and unfortunately not in a position to actually test this hypothesis. |
I think pep0479 might contain some additional background on the type of issue encountered here. |
@jcass77 it looks like you've taken a somewhat different approach to iterating the station list in mopidy-pandora. Given that and the fact that I'm still not able to reproduce the issue I'm going to close this issue. If this is still causing you problems feel free to re-open and I'll dig deeper into reproducing the error. |
I am comfortable to close this as the solution that I am using has been stable for many months now. I think the only point of discussion was whether it would make more sense for pydora to raise its own custom exception when no more tracks are being returned by But it is such a minor detail that we can probably leave it as is. |
A
StopIteration
exception can occur on rare occasions when retrieving the next Pandora track.Stack track details below:
This is supposed to be handled by
stop_iteration
, so not sure what the root cause is.The text was updated successfully, but these errors were encountered: