beets icon indicating copy to clipboard operation
beets copied to clipboard

No such file or directory when scrubbing

Open willgrnr opened this issue 11 years ago • 7 comments

I'm trying to use the scrub plugin. However it gets stuck and errors out when it tries to scrub the Tri-State album by Above & Beyond. It seems to think "C:\Users\100557855\Desktop\Mu sic\Above & Beyond\Tri\xe2\x80\x90State\01 Tri\xe2\x80\x90State.mp3" is the correct location, but it's really "C:\Users\100557855\Desktop\Music\Above & Beyond\Tri‐State\01 Tri-State.mp3". I'm not sure why it has only screwed up this one time, because for all the other functions and commands I've run, it's never had an issue with the filename.

scrubbing: C:\Users\100557855\Desktop\Music\Above & Beyond\TriΓÇÉState\01 TriΓÇÉ
State.mp3
Traceback (most recent call last):
  File "C:\Python27\Scripts\beet-script.py", line 9, in <module>
    load_entry_point('beets==1.3.10', 'console_scripts', 'beet')()
  File "C:\Python27\lib\site-packages\beets\ui\__init__.py", line 945, in main
    _raw_main(args)
  File "C:\Python27\lib\site-packages\beets\ui\__init__.py", line 935, in _raw_m
ain
    subcommand.func(lib, suboptions, subargs)
  File "C:\Python27\lib\site-packages\beetsplug\scrub.py", line 73, in scrub_fun
c
    config['id3v23'].get(bool))
  File "C:\Python27\lib\site-packages\beets\mediafile.py", line 1314, in __init_
_
    self.mgfile = mutagen.File(path)
  File "C:\Python27\lib\site-packages\mutagen\_file.py", line 221, in File
    fileobj = open(filename, "rb")
IOError: [Errno 2] No such file or directory: 'C:\\Users\\100557855\\Desktop\\Mu
sic\\Above & Beyond\\Tri\xe2\x80\x90State\\01 Tri\xe2\x80\x90State.mp3'

willgrnr avatar Feb 02 '15 05:02 willgrnr

Thanks for repotting. I've added error handling for this case. You should now get an error log instead of a crash when the file does not exist. (If this error is altogether wrong and the file does in fact exist, that's a different bug.)

sampsyo avatar Feb 02 '15 18:02 sampsyo

@sampsyo The issue I'm having is that I don't know how it is getting C:\Users\100557855\Desktop\Music\Above & Beyond\Tri\xe2\x80\x90State\01 Tri\xe2\x80\x90State.mp3 as the file location. It starts off by saying it's going to be scrubbing the file C:\Users\100557855\Desktop\Music\Above & Beyond\TriΓÇÉState\01 TriΓÇÉState.mp3 which is still incorrect as the proper location is C:\Users\100557855\Desktop\Music\Above & Beyond\Tri‐State\01 Tri-State.mp3. However when I performed lastgenre or fetchart commands, they both worked fine and reported the file location as C:\Users\100557855\Desktop\Music\Above & Beyond\TriΓÇÉState\01 TriΓÇÉState.mp3. So I'm not sure why the scrub plugin is butchering the file location to C:\Users\100557855\Desktop\Music\Above & Beyond\Tri\xe2\x80\x90State\01 Tri\xe2\x80\x90State.mp3.

willgrnr avatar Feb 02 '15 18:02 willgrnr

The difference you're seeing is just a different representation of the same path (escaped vs. rendered Unicode, filtered through your non-UTF-8 terminal).

But thanks for pointing out a different problem, which is that we were failing to pass a Unicode path to the Windows API. I just pushed a fix for that. Can you try it now?

sampsyo avatar Feb 02 '15 18:02 sampsyo

@sampsyo excuse my ignorance, but how do I push your update to my beets?

willgrnr avatar Feb 02 '15 19:02 willgrnr

It's in the FAQ: http://beets.readthedocs.org/en/v1.3.10/faq.html#src

sampsyo avatar Feb 02 '15 19:02 sampsyo

@sampsyo it works perfectly, no problems at all!

willgrnr avatar Feb 02 '15 20:02 willgrnr

Excellent news. :sparkles:

sampsyo avatar Feb 02 '15 20:02 sampsyo