🐛 fix(macos): yield individual site dirs in iter_*_dirs#429
Merged
gaborbernat merged 1 commit intotox-dev:mainfrom Feb 14, 2026
Merged
🐛 fix(macos): yield individual site dirs in iter_*_dirs#429gaborbernat merged 1 commit intotox-dev:mainfrom
gaborbernat merged 1 commit intotox-dev:mainfrom
Conversation
The base class iter_data_dirs/iter_config_dirs yields site_data_dir as a single string, which on macOS with multipath or XDG_DATA_DIRS set is a colon-joined string rather than individual paths. Unix already overrides these to yield from _site_data_dirs/_site_config_dirs, but macOS was missing the same overrides despite having multi-path site directory support (Homebrew-aware + XDG). Fixes tox-dev#377
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
On macOS,
iter_data_dirs()anditer_config_dirs()were falling back to the base class implementation which yieldssite_data_diras a single string. WhenXDG_DATA_DIRSis set with multiple paths (common on NixOS and similar setups) or under Homebrew where multiple site directories exist, this produced a colon-joined string like/path1:/path2instead of yielding each directory individually. 🐛The Unix platform already overrides both methods to
yield from self._site_data_dirs/self._site_config_dirs, correctly producing individual paths. macOS has the same_site_data_dirsand_site_config_dirsproperties (Homebrew-aware + XDG mixin) but was missing the matching overrides. This adds the identical overrides to_MacOSDefaults, consistent with the existing Unix approach.Windows is unaffected since it only has single-value site directories with no
_site_data_dirsproperty.Fixes #377