Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from
Dec 11, 2023

Conversation

dogo42
Copy link
Contributor

@dogo42 dogo42 commented Dec 9, 2023

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.

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 "<stdin>", line 1, in <module>
  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.
@wtoorop wtoorop merged commit 213345d into NLnetLabs:develop Dec 11, 2023
0 of 2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants