Use default tempdir for SI mutex on macOS

This commit is contained in:
Kovid Goyal 2025-03-28 15:31:30 +05:30
parent be1e9e029d
commit 7042e0fced
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C

View File

@ -5,11 +5,11 @@ import atexit
import errno
import os
import stat
import tempfile
import time
from functools import partial
from calibre.constants import __appname__, filesystem_encoding, islinux, ismacos, iswindows
from calibre.ptempfile import base_dir, get_default_tempdir
from calibre.utils.monotonic import monotonic
from calibre_extensions import speedup
@ -167,7 +167,8 @@ else:
__appname__, (os.geteuid() if per_user else ''), name
)
home = os.path.expanduser('~')
locs = ['/var/lock', home, tempfile.gettempdir()]
base_dir() # initialize get_default_tempdir()
locs = ['/var/lock', home, get_default_tempdir()]
if ismacos:
locs.insert(0, '/Library/Caches')
for loc in locs: