diff --git a/beets/util/__init__.py b/beets/util/__init__.py index ea08bb65d1..6c1759c2d1 100644 --- a/beets/util/__init__.py +++ b/beets/util/__init__.py @@ -547,7 +547,10 @@ def move(path: bytes, dest: bytes, replace: bool = False): ) finally: if tmp_filename: - os.remove(tmp_filename) + try: + os.remove(tmp_filename) + except OSError: + pass def link(path: bytes, dest: bytes, replace: bool = False): diff --git a/beetsplug/fetchart.py b/beetsplug/fetchart.py index e4de9181b5..65e3131e3b 100644 --- a/beetsplug/fetchart.py +++ b/beetsplug/fetchart.py @@ -1492,7 +1492,11 @@ def assign_art(self, session: ImportSession, task: ImportTask): candidate = self.art_candidates.pop(task) removal_enabled = self._is_source_file_removal_enabled() - self._set_art(task.album, candidate, not removal_enabled) + try: + self._set_art(task.album, candidate, not removal_enabled) + except util.FilesystemError as exc: + self._log.warning("failed to set album art: {}", exc) + return if removal_enabled: task.prune(candidate.path) diff --git a/docs/changelog.rst b/docs/changelog.rst index 3938d26a45..449f09936a 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -24,6 +24,8 @@ Bug fixes - :doc:`plugins/musicbrainz`: Fix fetching very large releases that have more than 500 tracks. :bug:`6355` - :doc:`plugins/badfiles`: Fix number of found errors in log message +- :doc:`plugins/fetchart`: Gracefully handle permissions errors when setting + album art instead of crashing the import. :bug:`6193` .. For plugin developers