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

[BUG] Config files creation ignoring home directory and $HOME/.config #28

Closed
Blocked opened this issue Feb 21, 2022 · 4 comments
Closed

Comments

@Blocked
Copy link

Blocked commented Feb 21, 2022

Describe the bug
webchanges seems to check the root folder, creates and stores config files in the first accessible folder: /data/data/com.termux/shared_prefs/webchanges/jobs.yaml. urlwatch stores it correctly in XDG_CONFIG_HOME:$HOME/.config/urlwatch. $HOME would be /data/data/com.termux/files/home. Migration fails.

To Reproduce
Run webchanges in a non standard prefixed environment.

Expected behavior
Default config files should be stored in $HOME/.config/*.

Version info
Please run webchanges -v and paste the version information as follows (first 3 lines):

  • webchanges 3.9.1
  • Python 3.10.2
  • System Linux-4.14-perf+-aarch64-with-libc(Termux/Android)
@Blocked Blocked changed the title [BUG] Config files creation ignoring home directory and $PREFIX [BUG] Config files creation ignoring home directory and $HOME/.config Feb 21, 2022
@mborsetti
Copy link
Owner

Thanks.

The location is determined by a call to platformdirs, and according to its documentation in Unix (Linux) it should be

the config directory tied to the user, e.g. ~/.config/$appname/$version or $XDG_CONFIG_HOME/$appname/$version.

appdirs is effectively unmaintained; platformdirs is the community's forked replacement.

@Blocked
Copy link
Author

Blocked commented Feb 28, 2022

If I read the code correctly, it seems to always use platformdirs. Am I right? Does it always use platformdirs or only the first run and it saves it somewhere?

@mborsetti
Copy link
Owner

If I read the code correctly, it seems to always use platformdirs. Am I right? Does it always use platformdirs or only the first run and it saves it somewhere?

Correct, it always uses platformdirs (never saves it); specifically, from cli.py:

    if os.name != 'nt':
        config_path = user_config_path(__project_name__)  # typically ~/.config/{__project_name__}

where user_config_path is imported from platformdirs

@Blocked
Copy link
Author

Blocked commented Feb 28, 2022

Thanks. I guess this is a upstream issue.

@Blocked Blocked closed this as completed Feb 28, 2022
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