mirror of
https://salsa.debian.org/freeipa-team/freeipa.git
synced 2024-12-24 16:10:02 -06:00
Fix handle python-dns UnicodeError
Reviewed-By: Jan Cholasta <jcholast@redhat.com>
This commit is contained in:
parent
11c250a612
commit
9f5e77f686
@ -18,6 +18,7 @@
|
|||||||
#
|
#
|
||||||
|
|
||||||
import dns.name
|
import dns.name
|
||||||
|
import dns.exception
|
||||||
import copy
|
import copy
|
||||||
|
|
||||||
|
|
||||||
@ -35,10 +36,10 @@ class DNSName(dns.name.Name):
|
|||||||
labels = labels.labels
|
labels = labels.labels
|
||||||
try:
|
try:
|
||||||
super(DNSName, self).__init__(labels)
|
super(DNSName, self).__init__(labels)
|
||||||
except UnicodeError:
|
except UnicodeError, e:
|
||||||
#dnspython bug, punycoded label longer than 63 returns UnicodeError
|
# dnspython bug, an invalid domain name returns the UnicodeError
|
||||||
#instead of LabelTooLong
|
# instead of a dns.exception
|
||||||
raise dns.name.LabelTooLong()
|
raise dns.exception.SyntaxError(e)
|
||||||
|
|
||||||
def __nonzero__(self):
|
def __nonzero__(self):
|
||||||
#dns.name.from_text('@') is represented like empty tuple
|
#dns.name.from_text('@') is represented like empty tuple
|
||||||
|
Loading…
Reference in New Issue
Block a user