]> granicus.if.org Git - python/commitdiff
Make error message less misleading for u"a..b".encode("idna").
authorWalter Dörwald <walter@livinglogic.de>
Fri, 14 Apr 2006 17:00:36 +0000 (17:00 +0000)
committerWalter Dörwald <walter@livinglogic.de>
Fri, 14 Apr 2006 17:00:36 +0000 (17:00 +0000)
Lib/encodings/idna.py

index 1f601c98d004360e5c48bc9ff009da728bbe9f0a..1aa4e965ef54f323f010e79ad32175b94d5f2a76 100644 (file)
@@ -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