Toblerity/rtree

"Unable to open file '%s' for index storage" - Write permissions on index should not be required

jason-curtis opened this issue · 1 comments

I have an application which uses rtree and a .idx index file. The index is pre-cached in my filesystem and doesn't need to be updated. The system is running on AWS Lambda so the user doesn't have write permissions to the source directory.

However, rtree checks explicitly that the directory is writeable:

rtree/rtree/index.py

Lines 247 to 250 in 68cb6ac

d = os.path.dirname(p)
if not os.access(d, os.W_OK):
message = "Unable to open file '%s' for index storage" % f
raise OSError(message)

This is crashing my program. Is there a way to tell rtree to treat the index as read-only?

oops, closing as duplicate of #247