Restore multiprocessing test on macOS

Needed to make the temp dir path shorter
This commit is contained in:
Kovid Goyal 2025-03-28 10:53:07 +05:30
parent 2081decec5
commit 55a8499995
No known key found for this signature in database
GPG Key ID: 06BC317B515ACE7C
2 changed files with 3 additions and 16 deletions

View File

@ -7,19 +7,10 @@ being closed.
import os
import tempfile
from calibre.constants import __appname__, __version__, filesystem_encoding, get_windows_temp_path, ismacos, iswindows
from calibre.constants import __appname__, filesystem_encoding, get_windows_temp_path, ismacos, iswindows
from calibre.utils.safe_atexit import remove_dir, remove_file_atexit, remove_folder_atexit, unlink
_base_dir = None
def app_prefix(prefix):
if iswindows:
return f'{__appname__}_'
return f'{__appname__}_{__version__}_{prefix}'
_osx_cache_dir = None
_base_dir = _osx_cache_dir = None
def osx_cache_dir():
@ -66,7 +57,7 @@ def base_dir():
base = os.environ.get('CALIBRE_TEMP_DIR', None)
if base is not None and iswindows:
base = os.getenv('CALIBRE_TEMP_DIR')
prefix = app_prefix('tmp_')
prefix = f'{__appname__}-'
if base is None:
if iswindows:
# On windows, if the TMP env var points to a path that

View File

@ -556,10 +556,6 @@ class BuildTest(unittest.TestCase):
def test_multiprocessing():
if ismacos:
# skip because this tests fails on some macOS systems with
# OSError: AF_UNIX path too long. Sigh.
return
from multiprocessing import get_all_start_methods, get_context
for stype in get_all_start_methods():
if stype == 'fork':