NLnetLabs / ldns

LDNS is a DNS library that facilitates DNS tool programming
https://nlnetlabs.nl/ldns
BSD 3-Clause "New" or "Revised" License
285 stars 94 forks source link

python3 bindings: ldnsx.py "class resolver" fix #228

Closed dogo42 closed 7 months ago

dogo42 commented 7 months ago

Imitating the example in the beginning of ldnsx.py results in error:

host:~/rpmbuild# python Python 3.9.16 (main, Dec 8 2022, 00:00:00) [GCC 11.3.1 20221121 (Red Hat 11.3.1-4)] on linux Type "help", "copyright", "credits" or "license" for more information.

import ldnsx dir(ldnsx) ['builtins', 'cached', 'doc', 'file', 'loader', 'name', 'package', 'spec', 'version', '_rr_types', 'calendar', 'get_rrs', 'isValidIP', 'ldns', 'packet', 'query', 'resolver', 'resource_record', 'secure_query', 'socket', 'sys', 'time', 'warnings'] ldnsx.resolver("9.9.9.9").query("www.hole.fi", "A") Traceback (most recent call last): File "", line 1, in File "/usr/lib64/python3.9/site-packages/ldnsx.py", line 220, in init nm_list.reverse() AttributeError: 'filter' object has no attribute 'reverse'

This patch fixes it, i.e. just add list( .. ) around the filter lambda.