Toblerity / rtree

Rtree: spatial index for Python GIS

Home Page:https://rtree.readthedocs.io

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rtree.finder.load() fails to raise when library spatialindex_c is missing

gmloose opened this issue · comments

Rtree.finder.load() doesn't raise an OSError when spatialindex_c library cannot be found.

Reason:
The call to function find_library (line 115 in finder.py) returns None, however the encapsulating function ctypes.cdll.LoadLibrary (line 114 in finder.py) returns <CDLL 'None', handle 7f0aa7733150 at 0x7f0a98881940> when you feed it a None. Hence rt is not None and the OSError is never raised.

From 855d8e0 this might raise something like:

OSError: None: cannot open shared object file: No such file or directory

although it's not understood where this scenario may occur.

I've reported this issue, because I ran into it. Unfortunately, I don't know the exact details anymore, except for the analysis I gave. So, I cannot tell you exactly which scenario triggered this bug. But it's still a bug. Simply closing this issue won't help resolving it.

Reopen if you can recreate the issue with the forthcoming release (probably out tomorrow). This is closed because it is believed to be resolved from recent changes.

OK, I'll have a look next week, if I find the time. Thanks.