Closed thfrkielikone closed 2 months ago
This is also apparently an issue in OpusTools. I don't know exactly why that database file is opened in write mode, maybe @miau1 can comment on this? Quickly looking at the code, opus_get
seems to have some DB related options, but opus_read
(used by OpusFilter) does not.
If the file needs to be writable, lib doesn't sound a proper place for the file even inside a venv, but a customizable location with a sensible default like ~/.OpusTools/opusdata.db
.
The database is opened in write mode to uncompress it the first time opus_get
is used. But actually the database is needed only when using the --local_db
option, so now the file is uncompressed only the first the --local_db
option is used. Additionally, the default location of the db file is now ~/.OpusTools/opusdata.db
. Both of these changes are in the latest version of OpusTools, also in PyPI
Thank you very much for solving this small gripe.
This is not much of a breaking bug, but I'd wanna ask whether this is intended behaviour. If I have opusfilter installed as root and then want to use it as a non-root user. I get the following behaviour:
I can give the .yml but I don't think it is relevant to this. My gripe is that it tries to create the opusdata.db file to a system location. Would something like a dot-directory (~/.local, ~/.cache, ...) be better here? Would that break some use case?
I am running this in a docker+singularity situation where because of the container nature of the thing, installing as root makes sense (but running as root doesn't, because the singularity env doesn't allow it). I understand that the equivalent location when using a venv would neatly be inside the venv, and that is what I am going to try next for my own purposes. Still, would this be neater if the db file would be stored somewhere else?