question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

macOS `user_config_dir` goes against OS guidelines

See original GitHub issue

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.

Issue Analytics

  • State:open
  • Created a year ago
  • Reactions:2
  • Comments:13 (5 by maintainers)

github_iconTop GitHub Comments

2reactions
ofekcommented, Aug 29, 2022

The problem is this would be a breaking change 🤔 for a lot of apps.

New major release?

1reaction
probablykaspercommented, Aug 29, 2022

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 Library/Application Support can include configuration files. The Where You Should Put Your App’s Files section does not mention the Preferences folder at all - it only says that Application Support can include configuration files.

The NSUserDefaults docs also has a warning about accessing it directly:

Don’t try to access the preferences subsystem directly. Modifying preference property list files may result in loss of changes, delay of reflecting changes, and app crashes. To configure preferences, use the defaults command-line utility in macOS instead.

I hope that clears it up

Read more comments on GitHub >

github_iconTop Results From Across the Web

os - Go Packages
UserHomeDir returns the current user's home directory. On Unix, including macOS, it returns the $HOME environment variable. On Windows, it returns %USERPROFILE% ...
Read more >
proposal: os: add UserConfigDir · Issue #29960 · golang/go
UserCacheDir in #22536, and 1.12 is adding os.UserHomeDir in #26463. ... I don't know how I feel about $HOME/Library/Preferences on macOS.
Read more >
file, err - - The Go Programming Language
12 // 13 // The os interface is intended to be uniform across all operating systems. ... operations on a File may be...
Read more >
Installing Go - Play with Go
Get started with Go. Installing Go. Note: this guide is running on Linux. For Mac or Windows steps, see the official Download and...
Read more >
macos - What is standard for OS X filesystem? e.g. /opt/ vs. /usr
Is there a manual or guide to what all of the built-in directories should be used for? Like what is /home/, or /net/?....
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found