Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Paths can be overridden using environment variables on Linux, but not MacOS? #269

Open
bede opened this issue Mar 5, 2024 · 5 comments
Open

Comments

@bede
Copy link

bede commented Mar 5, 2024

Thanks for creating platformdirs. I was surprised to learn that while on Linux, user_data_dir() can be overridden with $XDG_DATA_HOME (unix.py), it cannot be overridden on MacOS (macos.py).

It would be very useful if a single environment variable could be used to override the OS-specific default chosen by platformdirs. My assumption was that this is what platformdirs did until I tested it. Perhaps this could be made clearer to avoid confusion? I'm happy to PR the readme if welcomed.

@gaborbernat
Copy link
Contributor

gaborbernat commented Mar 5, 2024

Duplicate of #4

@gaborbernat gaborbernat marked this as a duplicate of #4 Mar 5, 2024
@bede
Copy link
Author

bede commented Mar 5, 2024

Hi @gaborbernat, evidently this path is well trodden, but did you read the final sentence?

Perhaps this could be made clearer to avoid confusion? I'm happy to PR the readme if welcomed.

I simply asked if clarification of the readme is welcome as a PR. That way fewer people will be surprised by the library not working as they expected. The extent of activity related to #4 shows that a lot of people are confused by this.

Also, the Readme says:

On Linux (and other Unices), according to the XDG Basedir Spec, it should be:

This is somewhat misleading since MacOS is a Unix-based OS, but is not covered by the behaviours this sentence references. This sentence led me to believe the intended behaviour is a bug.

Would you in principle be happy to merge clarification of MacOS/Windows behaviour in the Readme?

@gaborbernat gaborbernat reopened this Mar 5, 2024
@gaborbernat
Copy link
Contributor

Would you in principle be happy to merge clarification of MacOS/Windows behaviour in the Readme?

Definitely 😊 while macOS claims to be POSIX-compliant, in practice at no point their docs encourage or document the use of the XDG_DATA_HOME env var and such would surprise some user if we'd add support.

@bede
Copy link
Author

bede commented Mar 6, 2024 via email

@gaborbernat
Copy link
Contributor

Agreed, please put in a PR with that.

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

No branches or pull requests

2 participants