Make IDNA return an empty string when the input is empty. Fixes #1163178.
Will backport to 2.4.
diff --git a/Lib/test/test_codecs.py b/Lib/test/test_codecs.py
index 5f799e0..5189e80 100644
--- a/Lib/test/test_codecs.py
+++ b/Lib/test/test_codecs.py
@@ -630,6 +630,12 @@
def test_builtin(self):
self.assertEquals(unicode("python.org", "idna"), u"python.org")
+ def test_stream(self):
+ import StringIO
+ r = codecs.getreader("idna")(StringIO.StringIO("abc"))
+ r.read(3)
+ self.assertEquals(r.read(), u"")
+
class CodecsModuleTest(unittest.TestCase):
def test_decode(self):