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

Unified Diff: Lib/encodings/idna.py

Issue 9682: socket.create_connection error message for domain subpart with invalid length is very confusing
Patch Set: Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Please Sign in to add in-line comments.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | Lib/test/test_unicode.py » ('j') | Lib/test/test_unicode.py » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
--- a/Lib/encodings/idna.py Thu Apr 11 19:18:22 2013 -0500
+++ b/Lib/encodings/idna.py Sat Apr 13 13:14:34 2013 -0400
@@ -162,9 +162,9 @@
labels = result.split(b'.')
for label in labels[:-1]:
if not (0 < len(label) < 64):
- raise UnicodeError("label empty or too long")
+ raise UnicodeError("label empty or too long in %s" % result.decode())
r.david.murray 2013/04/13 21:49:49 Once we've determined that there is an error, I th
AntoinePitrou 2013/04/13 22:59:32 I disagree about doing .decode() at all here, sinc
mmilkin 2013/04/13 23:16:53 So it looks like L157 converts the input into asci
if len(labels[-1]) >= 64:
- raise UnicodeError("label too long")
+ raise UnicodeError("label too long %s" % labels[-1].decode())
AntoinePitrou 2013/04/13 22:59:32 Same here.
mmilkin 2013/04/13 23:18:04 Poke me if you disagree with my comment above On 2
return result, len(input)
result = bytearray()
« no previous file with comments | « no previous file | Lib/test/test_unicode.py » ('j') | Lib/test/test_unicode.py » ('J')

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