Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit 9fd459a

Browse files
committed
hack StringIO's repr, so it doesn't give an encoding
1 parent c4c0eae commit 9fd459a

1 file changed

Lines changed: 5 additions & 0 deletions

File tree

Lib/_pyio.py

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1829,3 +1829,8 @@ def __init__(self, initial_value="", newline="\n"):
18291829
def getvalue(self):
18301830
self.flush()
18311831
return self.buffer.getvalue().decode(self._encoding, self._errors)
1832+
1833+
def __repr__(self):
1834+
# TextIOWrapper tells the encoding in its repr. In StringIO,
1835+
# that's a implementation detail.
1836+
return object.__repr__(self)

0 commit comments

Comments
 (0)