Note: the same behaviour exists for site_cache_dir
demonstration:
import os
from platformdirs import macos, unix
# hack to pretend we're under homebrew
macos.sys.prefix = "/opt/homebrew/"
print(macos.MacOS(multipath=True).site_data_dir)
print(macos.MacOS(multipath=True).site_data_path)
# force site_data_dir to be a multipath
os.environ["XDG_DATA_DIRS"] = "/foo:/bar"
print(unix.Unix(multipath=True).site_data_dir)
print(unix.Unix(multipath=True).site_data_path)
Output:
/opt/homebrew/share:/Library/Application Support
/opt/homebrew/share:/Library/Application Support
/foo:/bar
/foo
Should MacOS also just use the first element, so in the above: macos.MacOS(multipath=True).site_data_path == Path(/opt/homebrew/share)
Hi, I was wondering about this behaviour as I noticed there is a difference between how MacOS and Linux handle this property:
site_data_dir
is a:
separated multipathsite_data_dir
, even if this results in aPath
containing a:
This came from: https://github.com/pypa/pip/issues/12903.
Note: the same behaviour exists for
site_cache_dir
demonstration:
Output:
Should MacOS also just use the first element, so in the above:
macos.MacOS(multipath=True).site_data_path == Path(/opt/homebrew/share)