Can't resolve 46 characters domains
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
py3dns |
Fix Released
|
Medium
|
Unassigned |
Bug Description
Hi,
It's not possible resolve domain if any part of DNS (label) have 46 characters, for example:
>>> DNS.dnslookup(
Traceback (most recent call last):
File "/usr/lib64/
raise UnicodeError("label empty or too long")
UnicodeError: label empty or too long
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/usr/lib/
result = Base.DnsRequest
File "/usr/lib/
m.addQuesti
File "/usr/lib/
self.
File "/usr/lib/
buf = buf + (bytes(chr(n), enc) + label)
UnicodeError: encoding with 'idna' codec failed (UnicodeError: label empty or too long)
I think line 192 of Lib.py:
buf = buf + (bytes(chr(n), enc) + label)
is a nonsense (why is there IDNA encoding for num of chars of label?)
Thanks,
Petr Czepiec
Related branches
Changed in py3dns: | |
status: | New → Triaged |
importance: | Undecided → Medium |
I fixed it in branch https:/ /code.launchpad .net/~petr- czepiec/ py3dns/ py3dns, file DNS/Lib.py, line 192:
buf = buf + bytes([n]) + label
please check and merge it,
Petr Czepiec