Rietveld Code Review Tool
Help | Bug tracker | Discussion group | Source code | Sign in
(263416)

#9682: socket.create_connection error message for domain subpart with invalid length is very confusing

Can't Edit
Can't Publish+Mail
Start Review
Created:
6 years, 4 months ago by rdmurray
Modified:
6 years, 3 months ago
Reviewers:
pitrou, mmilkin
CC:
loewis, giampaolo.rodola, r.david.murray, mmilkin
Visibility:
Public.

Patch Set 1 #

Total comments: 8

Patch Set 2 #

Patch Set 3 #

Patch Set 4 #

Patch Set 5 #

Total comments: 7

Patch Set 6 #

Unified diffs Side-by-side diffs Delta from patch set Stats Patch
Lib/encodings/idna.py View 1 2 3 4 5 5 chunks +27 lines, -12 lines 0 comments Download
Lib/test/test_unicode.py View 1 2 3 4 5 2 chunks +80 lines, -0 lines 0 comments Download

Messages

Total messages: 7
r.david.murray
A suggestion, and a couple of style comments. http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py File Lib/encodings/idna.py (right): http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py#newcode165 Lib/encodings/idna.py:165: raise ...
6 years, 4 months ago #1
AntoinePitrou
http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py File Lib/encodings/idna.py (right): http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py#newcode165 Lib/encodings/idna.py:165: raise UnicodeError("label empty or too long in %s" % ...
6 years, 4 months ago #2
mmilkin
http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py File Lib/encodings/idna.py (right): http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py#newcode165 Lib/encodings/idna.py:165: raise UnicodeError("label empty or too long in %s" % ...
6 years, 4 months ago #3
mmilkin
http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py File Lib/encodings/idna.py (right): http://bugs.python.org/review/9682/diff/7853/Lib/encodings/idna.py#newcode167 Lib/encodings/idna.py:167: raise UnicodeError("label too long %s" % labels[-1].decode()) Poke me ...
6 years, 4 months ago #4
r.david.murray
Thanks for working more on this. As you will see I have a couple of ...
6 years, 4 months ago #5
mmilkin
Dave let me know what you think about the tests. http://bugs.python.org/review/9682/diff/7970/Lib/encodings/idna.py File Lib/encodings/idna.py (right): http://bugs.python.org/review/9682/diff/7970/Lib/encodings/idna.py#newcode64 ...
6 years, 4 months ago #6
mmilkin
6 years, 4 months ago #7
http://bugs.python.org/review/9682/diff/7970/Lib/encodings/idna.py
File Lib/encodings/idna.py (right):

http://bugs.python.org/review/9682/diff/7970/Lib/encodings/idna.py#newcode96
Lib/encodings/idna.py:96: validate_label(label)
Fair enough i can break the function down into just throwing the error

On 2013/04/27 03:04:44, r.david.murray wrote:
> I may get overruled on this :), but there is a question of speed here.  A
> function call is a lot more costly than the comparison.  I think I'd rather
see
> the 'if' preserved, and then a function called to raise the appropriate error.

> Then you would have only one function.
Sign in to reply to this message.

RSS Feeds Recent Issues | This issue
This is Rietveld 894c83f36cb7+