summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorWalter Dörwald <walter@livinglogic.de>2006-04-14 17:00:36 (GMT)
committerWalter Dörwald <walter@livinglogic.de>2006-04-14 17:00:36 (GMT)
commita40cf31de67c51bae91a897bd007fa36d6d5daf9 (patch)
tree53d43a46c9e321ea9895eb786645e870c5644257
parent82972e7f0120487da0edc1b87353b51d061b0278 (diff)
downloadcpython-a40cf31de67c51bae91a897bd007fa36d6d5daf9.zip
cpython-a40cf31de67c51bae91a897bd007fa36d6d5daf9.tar.gz
cpython-a40cf31de67c51bae91a897bd007fa36d6d5daf9.tar.bz2
Make error message less misleading for u"a..b".encode("idna").
-rw-r--r--Lib/encodings/idna.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/encodings/idna.py b/Lib/encodings/idna.py
index 1f601c9..1aa4e96 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