[issue9682] socket.create_connection error message for domain subpart with invalid length is very confusing

R. David Murray report at bugs.python.org
Sat Apr 20 20:09:09 CEST 2013


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 <report at bugs.python.org>
<http://bugs.python.org/issue9682>
_______________________________________


More information about the Python-bugs-list mailing list