Skip to content

Separates implementations of macOS dirs that share a default#473

Merged
gaborbernat merged 1 commit intotox-dev:mainfrom
Goddesen:fix-macos-xdg-wrong-defaults
Apr 6, 2026
Merged

Separates implementations of macOS dirs that share a default#473
gaborbernat merged 1 commit intotox-dev:mainfrom
Goddesen:fix-macos-xdg-wrong-defaults

Conversation

@Goddesen
Copy link
Copy Markdown
Contributor

@Goddesen Goddesen commented Apr 4, 2026

Some platform dirs on macOS share the same default directory. These would previously share a value set by a mixin-overwritten property such that if you were, for example, to set XDG_DATA_HOME but not XDG_CONFIG_HOME, both user_config_dir and user_data_dir would both return the value of XDG_DATA_HOME: The values you would overwrite with the XDG_* variables bled into one another if you didn't set all of them.

This commit moves the shared implementations to their own macos-internal helper methods for each of user_config_dir, user_data_dir, user_state_dir, _site_config_dirs, and _site_data_dirs. Each of these properties now call to their respective helper method separately so that none of them bleed into others through a mixin-overwritten default property.

Some platform dirs on macOS share the same default directory. These
would previously share a value set by a mixin-overwritten property such
that if you were, for example, to set XDG_DATA_HOME but not
XDG_CONFIG_HOME, both `user_config_dir` and `user_data_dir` would both
return the value of XDG_DATA_HOME: The values you would overwrite with
the XDG_* variables bled into one another if you didn't set all of them.

This commit moves the shared implementations to their own macos-internal
helper methods for each of `user_config_dir`, `user_data_dir`,
`user_state_dir`, `_site_config_dirs`, and `_site_data_dirs`. Each of
these properties now call to their respective helper method separately
so that none of them bleed into others through a mixin-overwritten
default property.
Copy link
Copy Markdown
Member

@gaborbernat gaborbernat left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM

@gaborbernat gaborbernat merged commit 749ac3f into tox-dev:main Apr 6, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants