Opened 3 years ago

Closed 23 months ago

#9496 defect closed fixed (fixed)

twisted.names traceback on python 3

Reported by: Glyph Owned by: Tom Most
Priority: normal Milestone:
Component: names Keywords:
Cc: Branch: 9496-names-traceback
branch-diff, diff-cov, branch-cov, buildbot
Author:

Description

setup:

$ twist dns --port 5553 --cache --secondary=66.35.39.66/twistedmatrix.com
$ dig -p 5553 @localhost twistedmatrix.com

expected result: get some records, no traceback

actual result: get some records, then:

2018-07-22T02:20:33-0700 [DNSDatagramProtocol (UDP)] Unhandled Error
	Traceback (most recent call last):
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
	    result = f(*args, **kw)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/common.py", line 86, in lookupAddress
	    return self._lookup(name, dns.IN, dns.A, timeout)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/resolve.py", line 79, in _lookup
	    d = self.resolvers[0].query(q, timeout)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/common.py", line 78, in query
	    return defer.maybeDeferred(method, query.name.name, timeout)
	--- <exception caught here> ---
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/internet/defer.py", line 654, in _runCallbacks
	    current.result = callback(current.result, *args, **kw)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/resolve.py", line 29, in __call__
	    failure.trap(dns.DomainError, defer.TimeoutError, NotImplementedError)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/python/failure.py", line 439, in trap
	    self.raiseException()
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/python/failure.py", line 467, in raiseException
	    raise self.value.with_traceback(self.tb)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/internet/defer.py", line 151, in maybeDeferred
	    result = f(*args, **kw)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/common.py", line 86, in lookupAddress
	    return self._lookup(name, dns.IN, dns.A, timeout)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/secondary.py", line 161, in _lookup
	    return FileAuthority._lookup(self, name, cls, type, timeout)
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/authority.py", line 205, in _lookup
	    if dns._isSubdomainOf(name, self.soa[0]):
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/dns.py", line 258, in _isSubdomainOf
	    ancestorLabels = _nameToLabels(ancestorName.lower())
	  File "/Users/glyph/.virtualenvs/tmp-59fae94c7e8930d/lib/python3.6/site-packages/twisted/names/dns.py", line 225, in _nameToLabels
	    labels = name.split(b'.')
	builtins.TypeError: must be str or None, not bytes

Change History (9)

comment:1 Changed 3 years ago by Glyph

Owner: set to Tristan Seligmann

how about this one

comment:2 Changed 3 years ago by Yehuda Deutsch

I am testing bind compatibility, and am having same kind of issues. each time from anther line, for now the origin coming from the filename which is converted to string can't be concatenated to the names inside the zone.

There seems to be a lot of bytes and strings, and they don't always play along.

P.S. the mail module has the same issues, but the PY3 compatibility there goes deeper.

comment:3 Changed 3 years ago by Tristan Seligmann

Owner: Tristan Seligmann deleted

(Probably won't be looking at this, so unassigning)

comment:4 Changed 2 years ago by Tom Most

Branch: 9496-names-traceback
Owner: set to Tom Most
Status: newassigned

comment:6 Changed 2 years ago by Glyph

Should this be in review?

comment:7 Changed 2 years ago by Tom Most

Keywords: review added
Owner: Tom Most deleted
Status: assignednew

comment:8 Changed 23 months ago by Glyph

Keywords: review removed
Owner: set to Tom Most

Approved! See github for more details. Loved manually testing this and seeing the traceback go away :).

comment:9 Changed 23 months ago by Tom Most <twm@…>

Resolution: fixed
Status: newclosed

In 1d68f66:

Error: Processor CommitTicketReference failed
 does not appear to be a Git repository. See the log for more information.
Note: See TracTickets for help on using tickets.