[Twisted-Python] A bug of the DNSDatagramProtocol

yuyan zhang z858570636 at gmail.com
Thu Jun 6 21:24:07 MDT 2013


when i run the code:
        df = Deferred()
        name = Name('version.bind')
        axf = AXFRController(name,df)
        dns = DNSDatagramProtocol(axf)
        d = dns.query((ip,53),[Query('version.bind',TXT,CH)])
it raise the error :
Traceback (most recent call last):
  File "/usr/local/lib/python2.7/site-packages/twisted/python/log.py", line
73, in callWithContext
    return context.call({ILogContext: newCtx}, func, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py",
line 118, in callWithContext
    return self.currentContext().callWithContext(ctx, func, *args, **kw)
  File "/usr/local/lib/python2.7/site-packages/twisted/python/context.py",
line 81, in callWithContext
    return func(*args,**kw)
  File
"/usr/local/lib/python2.7/site-packages/twisted/internet/posixbase.py",
line 614, in _doReadOrWrite
    why = selectable.doRead()
--- <exception caught here> ---
  File "/usr/local/lib/python2.7/site-packages/twisted/internet/udp.py",
line 149, in doRead
    self.protocol.datagramReceived(data, addr)
  File "/usr/local/lib/python2.7/site-packages/twisted/names/dns.py", line
1936, in datagramReceived
    self.controller.messageReceived(m, self, addr)
exceptions.TypeError: messageReceived() takes exactly 3 arguments (4 given)
Unhandled Error

and the I set the DNSDatagramProtocol.datagramReceived's last row
self.controller.messageReceived(m, self, addr)
to
self.controller.messageReceived(m, self)
it'ok!
And this is a bug????
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://twistedmatrix.com/pipermail/twisted-python/attachments/20130607/f14ec76e/attachment.html>


More information about the Twisted-Python mailing list