mborsetti / webchanges

webchanges anonymously checks web content (including images) and commands for changes, delivering instant notifications and AI-powered summaries to your favorite platform.
https://pypi.org/project/webchanges/
Other
37 stars 6 forks source link

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

Closed Blocked closed 2 years ago

Blocked commented 2 years ago

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):

mborsetti commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

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 commented 2 years ago

Thanks. I guess this is a upstream issue.