R. David Murray added the comment:

The message in both branches of the if talk about empty labels, which is 
probably my fault since I got the sense of the if wrong in my suggestion.  One 
of them should be about the label being too long.  The one that should be the 
'empty' message also doesn't read right to my eyes.  As I said I think it 
should be something like: '"empty label in %r" % result.decode()'.

Also, in looking at the module code, there are several other places where the 
size check and simple message are used.  In all of these cases the string has 
already been confirmed to be (or converted to, in the case of the punycoding) 
ASCII.  So we can abstract this check into a function and call it from all 
those locations.

Do you want to update the patch accordingly, Mike?  It will need more tests.

----------
assignee: loewis -> 
type: enhancement -> behavior
versions: +Python 3.3, Python 3.4 -Python 3.2

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue9682>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to