Raised UnicodeError instead of LabelTooLong when label is longer than 63

35 views
Skip to first unread message

Martin Basti

unread,
Nov 6, 2013, 8:50:51 AM11/6/13
to dnspyth...@googlegroups.com
Hi,

using special unicode characters with length longer than 63 after encoding, raise UnicodeError instead LabelTooLong exception

Traceback:
UnicodeError                              Traceback (most recent call last)
<ipython-input-62-cce6ad634841> in <module>()

/usr/lib/python2.7/site-packages/dns/name.pyc in from_unicode(text, origin)
    576                 if len(label) == 0:
    577                     raise EmptyLabel
--> 578                 labels.append(encodings.idna.ToASCII(label))
    579                 label = u''
    580             elif c == u'\\':

/usr/lib64/python2.7/encodings/idna.pyc in ToASCII(label)
    101     if 0 < len(label) < 64:
    102         return label
--> 103     raise UnicodeError("label empty or too long")
    104 
    105 def ToUnicode(label):

UnicodeError: label empty or too long

Reply all
Reply to author
Forward
0 new messages