diff --git a/beets/util/artresizer.py b/beets/util/artresizer.py index 6fec62774..ae1476101 100644 --- a/beets/util/artresizer.py +++ b/beets/util/artresizer.py @@ -24,6 +24,7 @@ import platform import re import subprocess from abc import ABC, abstractmethod +from contextlib import suppress from enum import Enum from itertools import chain from typing import TYPE_CHECKING, Any, ClassVar @@ -846,7 +847,8 @@ class ArtResizer: ) finally: if result_path != path_in: - os.unlink(path_in) + with suppress(OSError): + os.unlink(path_in) return result_path @property diff --git a/docs/changelog.rst b/docs/changelog.rst index 640e46988..5408d2a5c 100644 --- a/docs/changelog.rst +++ b/docs/changelog.rst @@ -48,6 +48,8 @@ New features: Bug fixes: +- Handle potential OSError when unlinking temporary files in ArtResizer. + :bug:`5615` - :doc:`/plugins/spotify`: Updated Spotify API credentials. :bug:`6270` - :doc:`/plugins/smartplaylist`: Fixed an issue where multiple queries in a playlist configuration were not preserving their order, causing items to