From: Benjamin Peterson Date: Mon, 9 Mar 2009 00:09:44 +0000 (+0000) Subject: hack StringIO's repr, so it doesn't give an encoding X-Git-Tag: v3.1a2~305 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=9fd459a3a2ffed7bda16a96c46d2cbca448a5867;p=python hack StringIO's repr, so it doesn't give an encoding --- diff --git a/Lib/_pyio.py b/Lib/_pyio.py index 535c9ca433..771d4ce581 100644 --- a/Lib/_pyio.py +++ b/Lib/_pyio.py @@ -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)