[Python-checkins] python/dist/src/Lib/encodings idna.py, 1.4, 1.4.4.1
loewis@users.sourceforge.net
loewis at users.sourceforge.net
Thu Aug 25 13:04:15 CEST 2005
Update of /cvsroot/python/python/dist/src/Lib/encodings
In directory sc8-pr-cvs1.sourceforge.net:/tmp/cvs-serv11298/Lib/encodings
Modified Files:
Tag: release24-maint
idna.py
Log Message:
Make IDNA return an empty string when the input is empty. Fixes #1163178.
Index: idna.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/encodings/idna.py,v
retrieving revision 1.4
retrieving revision 1.4.4.1
diff -u -d -r1.4 -r1.4.4.1
--- idna.py 23 Mar 2004 23:40:36 -0000 1.4
+++ idna.py 25 Aug 2005 11:04:04 -0000 1.4.4.1
@@ -149,6 +149,9 @@
# IDNA is quite clear that implementations must be strict
raise UnicodeError, "unsupported error handling "+errors
+ if not input:
+ return "", 0
+
result = []
labels = dots.split(input)
if labels and len(labels[-1])==0:
@@ -166,6 +169,9 @@
if errors != 'strict':
raise UnicodeError, "Unsupported error handling "+errors
+ if not input:
+ return u"", 0
+
# IDNA allows decoding to operate on Unicode strings, too.
if isinstance(input, unicode):
labels = dots.split(input)
More information about the Python-checkins
mailing list