diff options
author | Benjamin Peterson <benjamin@python.org> | 2014-11-12 15:23:35 (GMT) |
---|---|---|
committer | Benjamin Peterson <benjamin@python.org> | 2014-11-12 15:23:35 (GMT) |
commit | 994c7f76a3cffd123183b2437580d3d4f09ab197 (patch) | |
tree | 2cb55213f289e4920026946d0603ce3488b85f22 /Lib/test/test_io.py | |
parent | c216c4869921cb9ade491704f945d6f1401ccbcc (diff) | |
parent | 6c14f231005a2a3a63bd4b0157c908e94bd834ac (diff) | |
download | cpython-994c7f76a3cffd123183b2437580d3d4f09ab197.zip cpython-994c7f76a3cffd123183b2437580d3d4f09ab197.tar.gz cpython-994c7f76a3cffd123183b2437580d3d4f09ab197.tar.bz2 |
merge 3.4 (#22849)
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 16 |
1 files changed, 16 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index a3567fa..746f59b 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -2856,6 +2856,22 @@ class TextIOWrapperTest(unittest.TestCase): self.assertEqual(t.read(200), bytes_val.decode('utf-8')) + def test_issue22849(self): + class F(object): + def readable(self): return True + def writable(self): return True + def seekable(self): return True + + for i in range(10): + try: + self.TextIOWrapper(F(), encoding='utf-8') + except Exception: + pass + + F.tell = lambda x: 0 + t = self.TextIOWrapper(F(), encoding='utf-8') + + class MemviewBytesIO(io.BytesIO): '''A BytesIO object whose read method returns memoryviews rather than bytes''' |