You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Greetings,
I tried running the example code in the README for cymru-services, and I kept running into an issue with the line "client.lookup(ip,qType='IP')" giving me an AddressValueError from the ipaddress module. It ended up being a problem in cymru/core/dns.py
Below is the patch to fix:
--- cymru/core/dns.py 2014-08-20 15:39:39.000000000 -0400
+++ cymru.delta/core/dns.py 2014-08-20 15:40:18.000000000 -0400
@@ -51,7 +51,7 @@
# clean values and type IP values
if qType is None:
qType=self.QTYPES[0]
- values = [str(value).strip() for value in values]
+ values = [unicode(value).strip() for value in values]
log.debug("values :%s" % (values))
if qType in ['IP','IP6']:
values = [ip_expand(value) for value in values]
The text was updated successfully, but these errors were encountered:
I'm using Python 2.7 and have installed the back-port of ipaddress. My test case is the example in the README. I hadn't realized that your codebase is Python3-only. Your code works fine in Python2 except for the call to "str(value)", which converts unicode to bytes, which ipaddress balks at.
You can also install python-IPy which is supposed to be the python 2
solution.
The code is working with 2.7+IPy or python 3
Le 23 août 2014 18:59, "dogwynn" [email protected] a écrit :
I'm using Python 2.7 and have installed the back-port of ipaddress. My
test case is the example in the README. I hadn't realized that your
codebase is Python3-only. Your code works fine in Python2 except for the
call to "str(value)", which converts unicode to bytes, which ipaddress
balks at.
—
Reply to this email directly or view it on GitHub #1 (comment)
.
Greetings,
I tried running the example code in the README for cymru-services, and I kept running into an issue with the line "client.lookup(ip,qType='IP')" giving me an AddressValueError from the ipaddress module. It ended up being a problem in cymru/core/dns.py
Below is the patch to fix:
The text was updated successfully, but these errors were encountered: