Skip to content

cymru/core/dns.py bytes/unicode error interfacing with ipaddress #1

@dogwynn

Description

@dogwynn

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]

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions