Index is checking write access despite assuming read-only access
LuckyLub opened this issue · 3 comments
Context
When passing a filename to the Index class, it assumes that the file can not be overwritten unless explicitly set by the user.
Lines 240 to 244 in 81cc81a
However, passing a file which is in a read-only dir is not allowed, since it is checked if the provided file is within a directory with write access.
Lines 255 to 256 in 81cc81a
Expected behavior
When the provided file is within a read-only directory, but overwrite self.properties.overwrite = False
the no OSError should be raised.
This is also causing problems for me - my .idx
is pre-cached and not writeable since I'm running on AWS Lambda. I can copy the files out to the .tmp directory but I'd rather not!
I took a crack at this in #281, removing the check in rtree
. Unfortunately the same check is happening in libspatialindex when we call down to the C code: https://libspatialindex.org/en/latest/doxygen/DiskStorageManager_8cc_source.html#l00173 .
So we could remove the checks on the Python level, but this would need to be pushed to the libspatialindex maintainers.