dnsgraph icon indicating copy to clipboard operation
dnsgraph copied to clipboard

Does this work on Python 3?

Open Flimm opened this issue 8 years ago • 5 comments
trafficstars

It's not clear from the README which Python versions this supports.

Flimm avatar Aug 11 '17 09:08 Flimm

@Flimm currently dnsgraph only works with Python 2, but I've just ported the command-line portions of it to work with Python 3 (see PR #4).

pabs3 avatar Aug 07 '21 01:08 pabs3

It still failed some times.

Traceback (most recent call last):
...
   return zone.resolve(name, rdtype)
  File "./tracegraph.py", line 105, in resolve
    return self.resolvers.values()[0].resolve(name, rdtype=rdtype, register=False)
TypeError: 'dict_values' object does not support indexing

I had to change this on line 105: return self.resolvers.values()[0].resolve(name, rdtype=rdtype, register=False) for: return list(self.resolvers.values())[0].resolve(name, rdtype=rdtype, register=False)

LatinSuD avatar Mar 07 '22 14:03 LatinSuD

@LatinSuD thanks, I've updated my fork to include that and given you credit on the relevant commit. I accidentally deleted my branch, so the PR got closed, but I submitted a new PR.

@seveas would appreciate if you could merge this PR.

-- bye, pabs

https://bonedaddy.net/pabs3/

pabs3 avatar Mar 07 '22 23:03 pabs3

There is still one catch that just happened to me.

...
  File "tracegraph.py", line 283, in resolve
    self.ip = list(self.root.resolve(self.name, dns.rdatatype.A))
TypeError: 'NoneType' object is not iterable

What happened is that "resolve()" returned None.

A fix could be adding an IF like this:

                resolvelist = self.root.resolve(self.name, dns.rdatatype.A)
                if resolvelist:
                    self.ip = list(resolvelist)

LatinSuD avatar Oct 18 '22 21:10 LatinSuD

@LatinSuD thanks, fixed in my branch.

-- bye, pabs

https://bonedaddy.net/pabs3/

pabs3 avatar Oct 19 '22 00:10 pabs3