diff options
author | Zackery Spytz <zspytz@gmail.com> | 2018-06-29 20:07:13 (GMT) |
---|---|---|
committer | Serhiy Storchaka <storchaka@gmail.com> | 2018-06-29 20:07:13 (GMT) |
commit | 0464de0f9a226cfa32b803e0326c12b2432aba26 (patch) | |
tree | d4c456790417ad6aeed6f5fd732546d3d3dbc001 /Lib/test/test_io.py | |
parent | 11ba050986b96701f72f1356d22adde8c7dbf211 (diff) | |
download | cpython-0464de0f9a226cfa32b803e0326c12b2432aba26.zip cpython-0464de0f9a226cfa32b803e0326c12b2432aba26.tar.gz cpython-0464de0f9a226cfa32b803e0326c12b2432aba26.tar.bz2 |
[2.7] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918). (GH-8013)
(cherry picked from commit 23db935bcf258657682e66464bf8512def8af830)
Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Diffstat (limited to 'Lib/test/test_io.py')
-rw-r--r-- | Lib/test/test_io.py | 11 |
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py index a725711..ebaf796 100644 --- a/Lib/test/test_io.py +++ b/Lib/test/test_io.py @@ -2741,6 +2741,17 @@ class TextIOWrapperTest(unittest.TestCase): with self.maybeRaises(TypeError): t.read(42) + def test_issue25862(self): + # Assertion failures occurred in tell() after read() and write(). + t = self.TextIOWrapper(self.BytesIO(b'test'), encoding='ascii') + t.read(1) + t.read() + t.tell() + t = self.TextIOWrapper(self.BytesIO(b'test'), encoding='ascii') + t.read(1) + t.write('x') + t.tell() + class CTextIOWrapperTest(TextIOWrapperTest): |