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.

Use of appdirs yields worse behavior on osx

See original GitHub issue

appdirs ignores XDG_CONFIG_HOME on macos and unconditionally wants to put the config in a macos-specific folder location.

Annoyingly there’s an appdirs issue which raises this and they just suggest that you artificially set the OS to be linux instead of darwin if you want linux behavior.

I’m going to also comment on their appdirs, but since this affects the behavior of ptpython specifically, i guess for now it’d be ideal for me if ptpython were do something like

if os.environ.get('XDG_CONFIG_HOME') and appdirs.system == 'darwin':
    appdirs.system = 'linux'

Issue Analytics

  • State:closed
  • Created 4 years ago
  • Comments:8 (4 by maintainers)

github_iconTop GitHub Comments

1reaction
DanCardincommented, Nov 23, 2020

I mean, I think that any user who is setting XDG_CONFIG_HOME is clearly attempting to opt into the behavior we’re talking about. It’s not obvious to me why that needs to have any OS significance. At which point the choice of PTPYTHON_CONFIG over XDG_CONFIG_HOME seems kind of arbitrary.

But i’ll take what i can get. Any way to opt into a specific location is a win in my book.

0reactions
larrybothacommented, May 23, 2021

Showing my support here for using $XDG_CONFIG_HOME

Something feels weird about appdirs distinction between MacOS and “other Unices”:

What directory should your app use for storing user data? If running on macOS, you should use: ~/Library/Application Support/<AppName> … On Linux (and other Unices) the dir, according to the XDG spec, is: ~/.local/share/<AppName>

Isn’t that odd - what is the significance of ~/Library/Application Support for one Unix distro, while other distros should use a spec written for Unix in general? That seems like magic to me.

Adding an environment variable is a small cost, and I appreciate that the addition has been made to allow for setting a config dir, but it does indeed feel dirty.

Using $XDG_CONFIG_HOME could improve UX in a number of areas:

  • Unix-agnostic - switching between distros is trivial
  • “just works” for people who already use XDG paths with other apps
  • no need to set additional env vars

Is this something the maintainers would be interested in considering?

Read more comments on GitHub >

github_iconTop Results From Across the Web

Allow macOS users to use XDG_CONFIG_HOME #78 - GitHub
The code here doesn't check for XDG_CONFIG_HOME if running macOS. ... Use of appdirs yields worse behavior on osx prompt-toolkit/ptpython# ...
Read more >
PyInstaller Documentation - Read the Docs
PyInstaller bundles a Python application and all its dependencies into a single package. ... PyInstaller is tested against Windows, MacOS X, and Linux....
Read more >
File and Directory Discovery, Technique T1083 - Enterprise
ID Name Description S0045 ADVSTORESHELL ADVSTORESHELL can list files and directories. S0031 BACKSPACE BACKSPACE allows adversaries to search for files. S0234 Bandook Bandook has a command...
Read more >
XPCShell tests — Firefox Source Docs documentation - Mozilla
xpcshell tests are quick-to-run tests, that are generally used to write unit tests. They do not have access to the full browser chrome...
Read more >
Difficult to install pyCrypto locally for SDK use ... - Issue Tracker
default method for installing PyCrypto on OSX puts it on a path that the ... Workaround: Install Crypto to somwhere else on os.path,...
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