From: Walter Dörwald Date: Fri, 14 Apr 2006 17:00:36 +0000 (+0000) Subject: Make error message less misleading for u"a..b".encode("idna"). X-Git-Tag: v2.5a2~229 X-Git-Url: http://git.ipfire.org/gitweb.cgi?a=commitdiff_plain;h=a40cf31de67c51bae91a897bd007fa36d6d5daf9;p=thirdparty%2FPython%2Fcpython.git Make error message less misleading for u"a..b".encode("idna"). --- diff --git a/Lib/encodings/idna.py b/Lib/encodings/idna.py index 1f601c98d004..1aa4e965ef54 100644 --- a/Lib/encodings/idna.py +++ b/Lib/encodings/idna.py @@ -70,7 +70,7 @@ def ToASCII(label): # Skip to step 8. if 0 < len(label) < 64: return label - raise UnicodeError("label too long") + raise UnicodeError("label empty or too long") # Step 2: nameprep label = nameprep(label) @@ -85,7 +85,7 @@ def ToASCII(label): # Skip to step 8. if 0 < len(label) < 64: return label - raise UnicodeError("label too long") + raise UnicodeError("label empty or too long") # Step 5: Check ACE prefix if label.startswith(uace_prefix): @@ -100,7 +100,7 @@ def ToASCII(label): # Step 8: Check size if 0 < len(label) < 64: return label - raise UnicodeError("label too long") + raise UnicodeError("label empty or too long") def ToUnicode(label): # Step 1: Check for ASCII