mjschultz/py-radix

Bug in pure python implementation

Closed this issue · 2 comments

The following code throws an exception with the Python only module:

rtree = radix.Radix()
rtree.add('1.0.24.0/23')
rtree.add('1.0.26.0/23')
rtree.add('1.0.28.0/22') # EXCEPTION

It works correctly when built with the C module.

The trace is as follows:

Traceback (most recent call last):
File ".\radix.py", line , in add
node = self._tree4.add(prefix)
File ".\radix.py", line , in add
r = addr[i] ^ test_addr[i]
TypeError: 'NoneType' object is not subscriptable

Thanks for the bug report and the testcase! I've added the testcase to the regression tests (b5973d3) and fixed the bug for that case as well.

I've put the fixed version up on PyPI (0.6.1), let me know if you find any other problems!

Thanks for fixing it so quickly!