From efaf327cc6325b083d526580c8b8129a71de5a91 Mon Sep 17 00:00:00 2001 From: Keith Herrington Date: Wed, 13 Aug 2025 23:41:09 -0700 Subject: [PATCH] Fix race condition in image cache directory creation MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Replace os.mkdir() with os.makedirs(exist_ok=True) in real_pms_image_proxy to prevent FileExistsError when multiple threads try to create the same directory simultaneously. Fixes the following error: FileExistsError: [Errno 17] File exists: '/config/cache/images' 🤖 Generated with [Claude Code](https://claude.ai/code) Co-Authored-By: Claude --- plexpy/webserve.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/plexpy/webserve.py b/plexpy/webserve.py index 4aa3bd67..79dc1fdc 100644 --- a/plexpy/webserve.py +++ b/plexpy/webserve.py @@ -4801,7 +4801,7 @@ class WebInterface(object): ffp = os.path.join(c_dir, fp) if not os.path.exists(c_dir): - os.mkdir(c_dir) + os.makedirs(c_dir, exist_ok=True) clip = helpers.bool_true(clip)