[Python-checkins] r70494 - in python/branches/py3k: Lib/_pyio.py Lib/test/test_memoryio.py Modules/_stringio.c

benjamin.peterson python-checkins at python.org
Sat Mar 21 04:08:32 CET 2009


Author: benjamin.peterson
Date: Sat Mar 21 04:08:31 2009
New Revision: 70494

Log:
stringio doesn't have an encoding

Modified:
   python/branches/py3k/Lib/_pyio.py
   python/branches/py3k/Lib/test/test_memoryio.py
   python/branches/py3k/Modules/_stringio.c

Modified: python/branches/py3k/Lib/_pyio.py
==============================================================================
--- python/branches/py3k/Lib/_pyio.py	(original)
+++ python/branches/py3k/Lib/_pyio.py	Sat Mar 21 04:08:31 2009
@@ -1834,3 +1834,7 @@
         # TextIOWrapper tells the encoding in its repr. In StringIO,
         # that's a implementation detail.
         return object.__repr__(self)
+
+    @property
+    def encoding(self):
+        return None

Modified: python/branches/py3k/Lib/test/test_memoryio.py
==============================================================================
--- python/branches/py3k/Lib/test/test_memoryio.py	(original)
+++ python/branches/py3k/Lib/test/test_memoryio.py	Sat Mar 21 04:08:31 2009
@@ -451,7 +451,7 @@
 
         # These are just dummy values but we nevertheless check them for fear
         # of unexpected breakage.
-        self.assertEqual(memio.encoding, "utf-8")
+        self.assertTrue(memio.encoding is None)
         self.assertEqual(memio.errors, "strict")
         self.assertEqual(memio.line_buffering, False)
 

Modified: python/branches/py3k/Modules/_stringio.c
==============================================================================
--- python/branches/py3k/Modules/_stringio.c	(original)
+++ python/branches/py3k/Modules/_stringio.c	Sat Mar 21 04:08:31 2009
@@ -665,7 +665,7 @@
 {
     CHECK_INITIALIZED(self);
     CHECK_CLOSED(self);
-    return PyUnicode_FromString("utf-8");
+    Py_RETURN_NONE;
 }
 
 static PyObject *


More information about the Python-checkins mailing list