From c2666bacd791e70a555e7d7fe1a35818b54c0905 Mon Sep 17 00:00:00 2001 From: Katelyn Gigante Date: Fri, 20 Jun 2025 02:05:52 +1000 Subject: [PATCH] core: Don't attempt to write to the inside of an OSX App Bundle (#4380) * core: Frozen OSX should also use Home Directory * Use Application Support instead of homedir * Suggested changes --- Utils.py | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/Utils.py b/Utils.py index f2038905..84d3a33d 100644 --- a/Utils.py +++ b/Utils.py @@ -166,6 +166,10 @@ def home_path(*path: str) -> str: os.symlink(home_path.cached_path, legacy_home_path) else: os.makedirs(home_path.cached_path, 0o700, exist_ok=True) + elif sys.platform == 'darwin': + import platformdirs + home_path.cached_path = platformdirs.user_data_dir("Archipelago", False) + os.makedirs(home_path.cached_path, 0o700, exist_ok=True) else: # not implemented home_path.cached_path = local_path() # this will generate the same exceptions we got previously @@ -177,7 +181,7 @@ def user_path(*path: str) -> str: """Returns either local_path or home_path based on write permissions.""" if hasattr(user_path, "cached_path"): pass - elif os.access(local_path(), os.W_OK): + elif os.access(local_path(), os.W_OK) and not (is_macos and is_frozen()): user_path.cached_path = local_path() else: user_path.cached_path = home_path()