]> granicus.if.org Git - python/commitdiff
hack StringIO's repr, so it doesn't give an encoding
authorBenjamin Peterson <benjamin@python.org>
Mon, 9 Mar 2009 00:09:44 +0000 (00:09 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 9 Mar 2009 00:09:44 +0000 (00:09 +0000)
Lib/_pyio.py

index 535c9ca433cce3c26cf722d08c386c0774446e0f..771d4ce5818399e8e85dbe02c47f7d6b23e84eaf 100644 (file)
@@ -1829,3 +1829,8 @@ class StringIO(TextIOWrapper):
     def getvalue(self):
         self.flush()
         return self.buffer.getvalue().decode(self._encoding, self._errors)
+
+    def __repr__(self):
+        # TextIOWrapper tells the encoding in its repr. In StringIO,
+        # that's a implementation detail.
+        return object.__repr__(self)