Context
When passing a filename to the Index class, it assumes that the file can not be overwritten unless explicitly set by the user.
|
# assume if the file exists, we're not going to overwrite it |
|
# unless the user explicitly set the property to do so |
|
if os.path.exists(p): |
|
|
|
self.properties.overwrite = bool(kwargs.get("overwrite", False)) |
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.
|
if not os.access(d, os.W_OK): |
|
message = "Unable to open file '%s' for index storage" % f |
Expected behavior
When the provided file is within a read-only directory, but overwrite self.properties.overwrite = False the no OSError should be raised.
Context
When passing a filename to the Index class, it assumes that the file can not be overwritten unless explicitly set by the user.
rtree/rtree/index.py
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.
rtree/rtree/index.py
Lines 255 to 256 in 81cc81a
Expected behavior
When the provided file is within a read-only directory, but overwrite
self.properties.overwrite = Falsethe no OSError should be raised.