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

Crash when showing size of replaced music that does not exist #1326

Closed
simonbcn opened this issue Feb 12, 2015 · 2 comments
Closed

Crash when showing size of replaced music that does not exist #1326

simonbcn opened this issue Feb 12, 2015 · 2 comments
Assignees
Labels
bug bugs that are confirmed and actionable
Milestone

Comments

@simonbcn
Copy link

beet git version updated now
Ubuntu 14.04 64 bits
Python 2.7.8

I have imported an album. I have deleted from disk. I have imported again and beets crash:

$ beet im /dunehd/Musica\ pendiente/Madonna\ –\ Rebel\ Heart\ \[Deluxe\ Edition\ 2015\]\(MP3\ 320\ Kbps\)/

/dunehd/Musica pendiente/Madonna – Rebel Heart [Deluxe Edition 2015](MP3 320 Kbps)/Track List (25 items)
Correcting tags from:
    Madonna - Rebel Heart Deluxe
To:
    Madonna - Rebel Heart (Super Deluxe Edition)
URL:
    http://musicbrainz.org/release/0911931a-3770-4cb7-ba67-3d2fda24d2e8
(Similarity: 97.5%) (album, tracks) (Digital Media, 2015)
 * Living For Love                               -> Living for Love
 * Bitch I'm Madonna (feat. Nicki Minaj)         -> Bitch I’m Madonna (title)
 * Iconic (feat. Chance the Rapper & Mike Tyson) -> Iconic (title)
 * Veni Vidi Vici (feat. Nas)                    -> Veni Vedi Vici (title)
This album is already in the library!
Traceback (most recent call last):
  File "/usr/local/bin/beet", line 9, in <module>
    load_entry_point('beets==1.3.11', 'console_scripts', 'beet')()
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/ui/__init__.py", line 953, in main
    _raw_main(args)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/ui/__init__.py", line 943, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/ui/commands.py", line 874, in import_func
    import_files(lib, paths, query)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/ui/commands.py", line 851, in import_files
    session.run()
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/importer.py", line 316, in run
    pl.run_parallel(QUEUE_SIZE)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/util/pipeline.py", line 301, in run
    out = self.coro.send(msg)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/util/pipeline.py", line 160, in coro
    task = func(*(args + (task,)))
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/importer.py", line 1287, in user_query
    resolve_duplicates(session, task)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/importer.py", line 1299, in resolve_duplicates
    session.resolve_duplicate(task, found_duplicates)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/ui/commands.py", line 789, in resolve_duplicate
    not task.is_album,
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/ui/commands.py", line 446, in summarize_items
    total_filesize = sum([item.filesize for item in items])
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/dbcore/db.py", line 316, in __getattr__
    return self[key]
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/dbcore/db.py", line 224, in __getitem__
    return getters[key](self)
  File "/usr/local/lib/python2.7/dist-packages/beets-1.3.11-py2.7.egg/beets/library.py", line 424, in <lambda>
    getters['filesize'] = lambda i: os.path.getsize(syspath(i.path))
  File "/usr/lib/python2.7/genericpath.py", line 49, in getsize
    return os.stat(filename).st_size
OSError: [Errno 2] No such file or directory: '/home/simon/M\xc3\xbasica/Madonna/Rebel Heart (Super Deluxe Edition)/01 - Living for Love.mp3'
@sampsyo sampsyo changed the title beet import error when file doesn't exist Crash when showing size of replaced music that does not exist Feb 12, 2015
@sampsyo
Copy link
Member

sampsyo commented Feb 12, 2015

Thanks! This looks like it came from #1291. @tomjaspers, would you mind adding error-handling for the getsize call? This could just log a warning and return a dummy value like 0.

@sampsyo sampsyo added docs bug bugs that are confirmed and actionable and removed docs labels Feb 12, 2015
@sampsyo sampsyo added this to the 1.3.11 milestone Feb 12, 2015
@sampsyo
Copy link
Member

sampsyo commented Feb 14, 2015

Thank you, @tomjaspers! ✨

sampsyo added a commit that referenced this issue Feb 14, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug bugs that are confirmed and actionable
Projects
None yet
Development

No branches or pull requests

3 participants