-
Notifications
You must be signed in to change notification settings - Fork 1.8k
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
extraction failed: local variable 'archive' referenced before assignment #3041
Comments
Thanks!! I've fixed the immediate problem. Can you please give that a try? As for why beets is trying to extract an ordinary MP3, I don't have an answer for you… maybe that deserves closer investigation? |
Actually, now that I think of it: for path_test, handler_class in self.handlers():
if path_test(util.py3_path(self.toppath)):
break This stanza doesn't seem to bail out if there are no matching handlers. It seems to just continue on with the last handler, even if it didn't claim to be able to extract the file. I think we need to add: else:
return to abort when there is no match. Would that make sense? |
Getting this result now:
|
Weird! For what it's wort, I'm able to reproduce this if I use the
I'm not exactly sure what to suggest. We could whitelist filename extensions, for example, or fall back to an ordinary import procedure if extraction fails? |
Problem
When trying to import a mp3-file as a singleton, I get the following error:
extraction failed: local variable 'archive' referenced before assignment
The file is is a mp3-version of this song (
youtube-dl -x ...
).After digging in the code, I found this line: importer.py
If
handler_class()
throws an error,archive.close()
is not assigned when called in thefinally
block.By the way, why does beets try to extract a mp3-file?
Here's a link to the music files that trigger the bug (if relevant):
https://www.youtube.com/watch?v=JibljZBesgM
Setup
The text was updated successfully, but these errors were encountered: