fluves / pywaterinfo

Python package to download time series data from waterinfo.be
https://fluves.github.io/pywaterinfo/
MIT License
17 stars 9 forks source link

cache is written to non-user specific temp dir #49

Closed johanvdw closed 2 years ago

johanvdw commented 2 years ago

https://github.com/fluves/pywaterinfo/blob/a9538f3749c3cb1a8204b12b076eef3328be0a0c/src/pywaterinfo/waterinfo.py#L76

Will write a file:

ls /tmp/pywaterinfo_cache.sqlite  -al
-rw-r--r-- 1 niels users 7217152 Feb  2 09:09 /tmp/pywaterinfo_cache.sqlite

which is owned by a specific user. The next user trying waterinfo will get a sqlite3.OperationalError: attempt to write a readonly database.

johanvdw commented 2 years ago

https://requests-cache.readthedocs.io/en/stable/user_guide/files.html#system-paths

we should use use_cache_dir rather than use_temp