mjschultz / py-radix

Python radix tree implementation for IPv4 and IPv6 prefix matching.
Other
121 stars 37 forks source link

Bug in pure python implementation #3

Closed hadiasghari closed 10 years ago

hadiasghari commented 10 years ago

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

mjschultz commented 10 years ago

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!

hadiasghari commented 10 years ago

Thanks for fixing it so quickly!