{"action":"created","issue":{"url":"https://api.github.com/repos/beetbox/beets/issues/2351","repository_url":"https://api.github.com/repos/beetbox/beets","labels_url":"https://api.github.com/repos/beetbox/beets/issues/2351/labels{/name}","comments_url":"https://api.github.com/repos/beetbox/beets/issues/2351/comments","events_url":"https://api.github.com/repos/beetbox/beets/issues/2351/events","html_url":"https://github.com/beetbox/beets/issues/2351","id":197890525,"number":2351,"title":"Incorrect handling of file read errors in the scrub plugin","user":{"login":"lukash","id":135954,"avatar_url":"https://avatars.githubusercontent.com/u/135954?v=3","gravatar_id":"","url":"https://api.github.com/users/lukash","html_url":"https://github.com/lukash","followers_url":"https://api.github.com/users/lukash/followers","following_url":"https://api.github.com/users/lukash/following{/other_user}","gists_url":"https://api.github.com/users/lukash/gists{/gist_id}","starred_url":"https://api.github.com/users/lukash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukash/subscriptions","organizations_url":"https://api.github.com/users/lukash/orgs","repos_url":"https://api.github.com/users/lukash/repos","events_url":"https://api.github.com/users/lukash/events{/privacy}","received_events_url":"https://api.github.com/users/lukash/received_events","type":"User","site_admin":false},"labels":[],"state":"closed","locked":false,"assignee":null,"assignees":[],"milestone":null,"comments":2,"created_at":"2016-12-28T17:44:42Z","updated_at":"2016-12-28T21:48:13Z","closed_at":"2016-12-28T21:39:28Z","body":"### Problem\r\n\r\nUpdating my whole library:\r\n\r\n```sh\r\n$ beet import -L\r\n```\r\n\r\nLed to this problem:\r\n\r\n```\r\nerror reading FILE1: 'FILE1'\r\nerror reading FILE2: 'FILE2'\r\nscrub: could not open file to scrub: 'FILE2'\r\nTraceback (most recent call last):\r\n  File \"/usr/lib/python-exec/python2.7/beet\", line 11, in <module>\r\n    load_entry_point('beets==1.4.2', 'console_scripts', 'beet')()\r\n  File \"/usr/lib64/python2.7/site-packages/beets/ui/__init__.py\", line 1209, in main\r\n    _raw_main(args)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/ui/__init__.py\", line 1196, in _raw_main\r\n    subcommand.func(lib, suboptions, subargs)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/ui/commands.py\", line 969, in import_func\r\n    import_files(lib, paths, query)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/ui/commands.py\", line 946, in import_files\r\n    session.run()\r\n  File \"/usr/lib64/python2.7/site-packages/beets/importer.py\", line 320, in run\r\n    pl.run_parallel(QUEUE_SIZE)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/util/pipeline.py\", line 445, in run_parallel\r\n    six.reraise(exc_info[0], exc_info[1], exc_info[2])\r\n  File \"/usr/lib64/python2.7/site-packages/beets/util/pipeline.py\", line 358, in run\r\n    self.coro.send(msg)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/util/pipeline.py\", line 171, in coro\r\n    task = func(*(args + (task,)))\r\n  File \"/usr/lib64/python2.7/site-packages/beets/importer.py\", line 1418, in manipulate_files\r\n    session=session,\r\n  File \"/usr/lib64/python2.7/site-packages/beets/importer.py\", line 688, in manipulate_files\r\n    plugins.send('import_task_files', session=session, task=self)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/plugins.py\", line 452, in send\r\n    result = handler(**arguments)\r\n  File \"/usr/lib64/python2.7/site-packages/beets/plugins.py\", line 124, in wrapper\r\n    return func(*args, **kwargs)\r\n  File \"/usr/lib64/python2.7/site-packages/beetsplug/scrub.py\", line 149, in import_task_files\r\n    self._scrub_item(item)\r\n  File \"/usr/lib64/python2.7/site-packages/beetsplug/scrub.py\", line 125, in _scrub_item\r\n    art = mf.art\r\nUnboundLocalError: local variable 'mf' referenced before assignment\r\n```\r\n\r\nI've checked the files, FILE1 has mp3 header missing and FILE2 seems to be damaged completely, according to mpv. This got me alarmed, but I suppose it's highly improbable it was caused by beets.\r\n\r\nThe traceback is clear regarding that `mf` variable. It would also be nice if it logged the cause of the error, instead of twice the filename (that seems a common problem with exceptions, they just contain the filename as a description and not the actual cause).\r\n\r\nSince this error interrupted the import process, I don't know how to finish where it left off :( Is calling `scrub` manually enough?\r\n\r\n\r\n### Setup\r\n\r\n* OS: Gentoo Linux\r\n* Python version: 2.7\r\n* beets version: 1.4.2"},"comment":{"url":"https://api.github.com/repos/beetbox/beets/issues/comments/269546353","html_url":"https://github.com/beetbox/beets/issues/2351#issuecomment-269546353","issue_url":"https://api.github.com/repos/beetbox/beets/issues/2351","id":269546353,"user":{"login":"lukash","id":135954,"avatar_url":"https://avatars.githubusercontent.com/u/135954?v=3","gravatar_id":"","url":"https://api.github.com/users/lukash","html_url":"https://github.com/lukash","followers_url":"https://api.github.com/users/lukash/followers","following_url":"https://api.github.com/users/lukash/following{/other_user}","gists_url":"https://api.github.com/users/lukash/gists{/gist_id}","starred_url":"https://api.github.com/users/lukash/starred{/owner}{/repo}","subscriptions_url":"https://api.github.com/users/lukash/subscriptions","organizations_url":"https://api.github.com/users/lukash/orgs","repos_url":"https://api.github.com/users/lukash/repos","events_url":"https://api.github.com/users/lukash/events{/privacy}","received_events_url":"https://api.github.com/users/lukash/received_events","type":"User","site_admin":false},"created_at":"2016-12-28T21:48:13Z","updated_at":"2016-12-28T21:48:13Z","body":"No worries, thanks for a quick fix :)"}}
{"actor":{"display_login":"lukash"}}