Skip to content

Use default XDG state dir for cachedir#11

Open
mochaaP wants to merge 1 commit intopuiterwijk:masterfrom
mcha-forks:master
Open

Use default XDG state dir for cachedir#11
mochaaP wants to merge 1 commit intopuiterwijk:masterfrom
mcha-forks:master

Conversation

@mochaaP
Copy link
Copy Markdown

@mochaaP mochaaP commented Sep 29, 2024

Use ~/.local/state/openidc for as default cachedir.

I did not pull in https://github.com/srstevenson/xdg-base-dirs or any other
environment variable detections since I'm unsure about the supported
Python version. This is good enough for standard Fedora setups.

Use ~/.local/state/openidc for as default cachedir.
@mochaaP
Copy link
Copy Markdown
Author

mochaaP commented Sep 29, 2024

I could submit another PR if you would like me to renovate the project and retarget it to Py3.7+. fedpkg relies on this and we likely need to move away from deprecated python package setups

@mochaaP
Copy link
Copy Markdown
Author

mochaaP commented Sep 29, 2024

cc @puiterwijk

self.useragent = useragent or 'python-openid-client/%s' % \
release.VERSION
self.cachedir = os.path.expanduser(cachedir or '~/.openidc')
self.cachedir = os.path.expanduser(cachedir or '~/.local/state/openidc')
Copy link
Copy Markdown

Choose a reason for hiding this comment

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

According to the XDG Base Directory Specification, this should try to read the $XDG_CACHE_HOME environment variable first, and if that is unset then fall back to $HOME/.cache.

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