mirror of
https://github.com/python/cpython.git
synced 2025-08-04 00:48:58 +00:00
Issue #10872: The repr() of TextIOWrapper objects now includes the mode
if available. (at Georg's request)
This commit is contained in:
parent
a6c91f5e3b
commit
a4815caa7c
4 changed files with 51 additions and 11 deletions
|
@ -1717,9 +1717,12 @@ class TextIOWrapperTest(unittest.TestCase):
|
|||
raw.name = "dummy"
|
||||
self.assertEqual(repr(t),
|
||||
"<%s.TextIOWrapper name='dummy' encoding='utf-8'>" % modname)
|
||||
t.mode = "r"
|
||||
self.assertEqual(repr(t),
|
||||
"<%s.TextIOWrapper name='dummy' mode='r' encoding='utf-8'>" % modname)
|
||||
raw.name = b"dummy"
|
||||
self.assertEqual(repr(t),
|
||||
"<%s.TextIOWrapper name=b'dummy' encoding='utf-8'>" % modname)
|
||||
"<%s.TextIOWrapper name=b'dummy' mode='r' encoding='utf-8'>" % modname)
|
||||
|
||||
def test_line_buffering(self):
|
||||
r = self.BytesIO()
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue