Comment 1 for bug 832480

Revision history for this message
Scott Kitterman (kitterman) wrote :

Fails in python3 too.

Traceback (most recent call last):
  File "spf.py", line 1673, in <module>
    receiver=socket.gethostname()))
  File "spf.py", line 304, in check
    res,code,exp = query(i=i, s=s, h=h, local=local, receiver=receiver).check()
  File "spf.py", line 503, in check
    spf = self.dns_spf(self.d)
  File "spf.py", line 1051, in dns_spf
    a = [t for t in self.dns_txt(domain) if RE_SPF.match(t)]
  File "spf.py", line 1086, in dns_txt
    return [''.join(a) for a in self.dns(domainname, 'TXT')]
  File "spf.py", line 1193, in dns
    for k, v in DNSLookup(name, qtype, self.strict, self.timeout):
  File "spf.py", line 128, in DNSLookup
    resp = req.req()
  File "/usr/lib/python3/dist-packages/DNS/Base.py", line 213, in req
    self.sendUDPRequest(server)
  File "/usr/lib/python3/dist-packages/DNS/Base.py", line 242, in sendUDPRequest
    r=self.processUDPReply()
  File "/usr/lib/python3/dist-packages/DNS/Base.py", line 115, in processUDPReply
    return self.processReply()
  File "/usr/lib/python3/dist-packages/DNS/Base.py", line 139, in processReply
    r=Lib.DnsResult(u,self.args)
  File "/usr/lib/python3/dist-packages/DNS/Lib.py", line 603, in __init__
    self.storeM(u)
  File "/usr/lib/python3/dist-packages/DNS/Lib.py", line 659, in storeM
    self.answers.append(self.storeRR(u))
  File "/usr/lib/python3/dist-packages/DNS/Lib.py", line 686, in storeRR
    r['data']=getattr(u, mname)()
  File "/usr/lib/python3/dist-packages/DNS/Lib.py", line 483, in getTXTdata
    tlist.append(str(self.getstring(), enc))
  File "/usr/lib/python3.2/encodings/idna.py", line 192, in decode
    result.append(ToUnicode(label))
  File "/usr/lib/python3.2/encodings/idna.py", line 125, in ToUnicode
    return str(label, "ascii")
UnicodeDecodeError: 'ascii' codec can't decode byte 0xef in position 9: ordinal not in range(128)

This should either be a pyspf or py(3)dns bug.