Menu

#20 DNS.revlookup crashes on server error

open
nobody
Bug fixes (9)
5
2010-04-05
2010-04-05
No

Python 2.6.4 (r264:75706, Dec 7 2009, 18:45:15)
[GCC 4.4.1] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import DNS
>>> DNS.revlookup('96.51.148.193')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/python2.6/dist-packages/DNS/lazy.py", line 20, in revlookup
return Base.DnsRequest(b, qtype = 'ptr').req().answers[0]['data']
IndexError: list index out of range

Patch to return the DNS status instead attached.

Discussion

  • Scott Kitterman

    Scott Kitterman - 2010-04-05
    • labels: --> Bug fixes
     
  • Scott Kitterman

    Scott Kitterman - 2010-04-15

    Better patch

     
  • Scott Kitterman

    Scott Kitterman - 2011-02-18

    Fixed in py3dns 3.0.0. Still open for python2.

     
  • Stuart D. Gathman

    An exception for the status error is good. If there is no PTR, however, this should return None. Also, revlookup should call revlookupall() and return the shortest (first?) name.

     
  • Stuart D. Gathman

    Concept incorporated in pydns-2.3.5