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

Fetchart failing from filename encoding issues #5211

Open
TheMarstonConnell opened this issue Apr 26, 2024 · 2 comments
Open

Fetchart failing from filename encoding issues #5211

TheMarstonConnell opened this issue Apr 26, 2024 · 2 comments
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."

Comments

@TheMarstonConnell
Copy link

Running beet fetchart -q gave me this output. It's clear the ' in the album name is causing issues due to some encoding stuff.

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 496, in move
    os.replace(path, dest)
FileNotFoundError: [Errno 2] No such file or directory: b'/tmp/tmpcpc4ja_m.jpg' -> b'/mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there\xe2\x80\x99s a tunnel under Ocean Blvd (2023)/cover.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 503, in move
    shutil.copyfile(path, tmp)
  File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there’s a tunnel under Ocean Blvd (2023)/.cover.jpgttx0xc_c.beets'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 508, in move
    raise FilesystemError(exc, 'move', (path, dest),
beets.util.FilesystemError: No such file or directory while moving /tmp/tmpcpc4ja_m.jpg to /mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there’s a tunnel under Ocean Blvd (2023)/cover.jpg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/beet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/beets/ui/__init__.py", line 1285, in main
    _raw_main(args)
  File "/usr/lib/python3.11/site-packages/beets/ui/__init__.py", line 1272, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.11/site-packages/beetsplug/fetchart.py", line 1083, in func
    self.batch_fetch_art(lib, lib.albums(ui.decargs(args)), opts.force,
  File "/usr/lib/python3.11/site-packages/beetsplug/fetchart.py", line 1145, in batch_fetch_art
    self._set_art(album, candidate)
  File "/usr/lib/python3.11/site-packages/beetsplug/fetchart.py", line 1048, in _set_art
    album.set_art(candidate.path, delete)
  File "/usr/lib/python3.11/site-packages/beets/library.py", line 1317, in set_art
    util.move(path, artdest)
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 512, in move
    os.remove(tmp)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there’s a tunnel under Ocean Blvd (2023)/.cover.jpgttx0xc_c.beets'
/ # beet fetchart -q
Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 496, in move
    os.replace(path, dest)
FileNotFoundError: [Errno 2] No such file or directory: b'/tmp/tmpgzsgna_3.jpg' -> b'/mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there\xe2\x80\x99s a tunnel under Ocean Blvd (2023)/cover.jpg'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 503, in move
    shutil.copyfile(path, tmp)
  File "/usr/lib/python3.11/shutil.py", line 258, in copyfile
    with open(dst, 'wb') as fdst:
         ^^^^^^^^^^^^^^^
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there’s a tunnel under Ocean Blvd (2023)/.cover.jpgkimvg4mk.beets'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 508, in move
    raise FilesystemError(exc, 'move', (path, dest),
beets.util.FilesystemError: No such file or directory while moving /tmp/tmpgzsgna_3.jpg to /mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there’s a tunnel under Ocean Blvd (2023)/cover.jpg

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "/usr/bin/beet", line 8, in <module>
    sys.exit(main())
             ^^^^^^
  File "/usr/lib/python3.11/site-packages/beets/ui/__init__.py", line 1285, in main
    _raw_main(args)
  File "/usr/lib/python3.11/site-packages/beets/ui/__init__.py", line 1272, in _raw_main
    subcommand.func(lib, suboptions, subargs)
  File "/usr/lib/python3.11/site-packages/beetsplug/fetchart.py", line 1083, in func
    self.batch_fetch_art(lib, lib.albums(ui.decargs(args)), opts.force,
  File "/usr/lib/python3.11/site-packages/beetsplug/fetchart.py", line 1145, in batch_fetch_art
    self._set_art(album, candidate)
  File "/usr/lib/python3.11/site-packages/beetsplug/fetchart.py", line 1048, in _set_art
    album.set_art(candidate.path, delete)
  File "/usr/lib/python3.11/site-packages/beets/library.py", line 1317, in set_art
    util.move(path, artdest)
  File "/usr/lib/python3.11/site-packages/beets/util/__init__.py", line 512, in move
    os.remove(tmp)
FileNotFoundError: [Errno 2] No such file or directory: '/mnt/import/lidarr/Lana Del Rey/Lana Del Rey/Did you know that there’s a tunnel under Ocean Blvd (2023)/.cover.jpgkimvg4mk.beets'

Setup

  • OS: docker alpine
  • Python version: Python 3.11.9
  • beets version: 1.6.0

My configuration (output of beet config) is:

directory: /mnt/content
library: /home/beets.db

plugins: fetchart embedart lastgenre
fetchart:
    cautious: yes
    cover_names: front back
    sources: filesystem coverart itunes amazon albumart wikipedia
    auto: yes
    minwidth: 0
    maxwidth: 0
    quality: 0
    max_filesize: 0
    enforce_ratio: no
    google_key: REDACTED
    google_engine: 001442825323518660753:hrh5ch1gjzm
    fanarttv_key: REDACTED
    lastfm_key: REDACTED
    store_source: no
    high_resolution: no
    deinterlace: no
    cover_format:
lastgenre:
    count: 5
    whitelist: yes
    min_weight: 10
    fallback:
    canonical: no
    source: album
    force: yes
    auto: yes
    separator: ', '
    prefer_specific: no
    title_case: yes

import:
    none_rec_action: skip

match:
    strong_rec_thresh: 0.2
    medium_rec_thresh: 0.0
    rec_gap_thresh: 0.8
embedart:
    maxwidth: 0
    auto: yes
    compare_threshold: 0
    ifempty: no
    remove_art_file: no
    quality: 0
@wisp3rwind
Copy link
Member

Setup

* OS: docker alpine

* Python version: Python 3.11.9

* beets version: 1.6.0

While you seem to be running a development version already: Please update to the latest source, the code path that is causing the error has not been in beets since 2022 (see #4209). Does the error still occur then?

@wisp3rwind wisp3rwind added the needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature." label Apr 27, 2024
@RiccardoUva
Copy link

same here, on windows it only works when you have your library and the imported file on the c drive

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
needinfo We need more details or follow-up from the filer before this can be tagged "bug" or "feature."
Projects
None yet
Development

No branches or pull requests

3 participants