-
-
Notifications
You must be signed in to change notification settings - Fork 52
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
macOS user_config_dir
goes against OS guidelines
#98
Comments
This reads to me that you can use this folder, just need to use a system class for it, which in Python case is missing so using file API instead feels ok. |
I don't think that's the case because the guidelines also say you can put configuration files in
|
I'm not sure I agree with that. Would Apple bother to create a CPython version of NSUserDefaults we could put it there. |
The defaults system is a database like the Windows Registry. There are pypi packages that let you interact with it, but I imagine it's probably out of scope for this package to provide an API to the defaults database. The docs state you "should never create files in this directory yourself" and that the The
I hope that clears it up |
The problem is this would be a breaking change 🤔 for a lot of apps. |
Yes it sure would :/ Luckily, migrating should be fairly easy in most cases:
|
Can you create a PR for that? |
Yeah I might give it a go |
New major release? |
@probablykasper I agree that Preferences is the wrong folder as it's only meant for Though isn't it also the case that
So it's really meant for various GUI apps that create the preference files themselves, but if a user is creating a supporting config file, it shouldn't be there |
I think you're making a false assumption that user-editable configs are intended to exist at all. I think the guidelines are designed with accessibility in mind, and manually editing config files is something only very advanced users do |
Interesting perspective, but in that case no folder is good and the guidelines are useless as a guide, why use them then? What's the point of referencing
) |
I'd say it's more that it's assumed that users don't manually edit config files, and that a user isn't someone advanced enough to understand how a config file works.
I never suggested it's the officially sanctioned way to store user-editable cli files. I mentioned it as the standard location for config files, not a standard location for user-editable cli files. It says to
They say to store config files that should be hidden there. I very rarely see config files that aren't hidden. Usually they're hidden in locations like |
Exactly the same discussion happened in the Rust equivalent of Side note - if both libraries (and any other equivalents) could align on the approach and have the same variables pointing to the same locations - that would be really beneficial for language-agnostic standardisation: |
Feel free to put in a PR to address it. |
Just as an extra argument for "Application Support": it's the default in Go as well. |
It would be good to decide / implement this rather sooner than later. The longer you wait, the more applications will have adopted |
This is an open source project. There's no plan to implement this ourselves. PR welcome if you're offering and want this feature 👋 |
@gaborbernat Here we go: #132 |
appdirs has this PR: https://github.com/ActiveState/appdirs/pull/186/files |
Fixed by #137, can be closed. |
Hi @probablykasper, is there any example on how to implement this migration? For example how to obtain the old value for the config dir? (Is it required to hardcode the value and do manually do the OS detection?) |
Yeah you'd have to take care of it manually. If you look through the PR you should see how to get the old path |
config_dir
points to~/Library/Preferences
on macOS:https://github.com/platformdirs/platformdirs/blob/2e225082877dd83329594933a69301b8c5b9246e/src/platformdirs/macos.py#L27-L34
This goes against macOS guidelines:
Preferences
Contains the user’s preferences. You should never create files in this directory yourself. To get or set preference values, you should always use the
NSUserDefaults
class or an equivalent system-provided interface.The text was updated successfully, but these errors were encountered: