summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-06-29 10:34:34 (GMT)
committerGitHub <noreply@github.com>2018-06-29 10:34:34 (GMT)
commiteabebbb54c2604fd8d08e8019ea1be634aed8c2f (patch)
tree753a4129f0ff70097c60b461f916f230352d747b /Lib/test/test_io.py
parentd0b442803ad4ba66b0bdb3cf183179d4c9a56f06 (diff)
downloadcpython-eabebbb54c2604fd8d08e8019ea1be634aed8c2f.zip
cpython-eabebbb54c2604fd8d08e8019ea1be634aed8c2f.tar.gz
cpython-eabebbb54c2604fd8d08e8019ea1be634aed8c2f.tar.bz2
bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918)
(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.py11
1 files changed, 11 insertions, 0 deletions
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 286ae76..a03a7f7 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -3549,6 +3549,17 @@ class TextIOWrapperTest(unittest.TestCase):
expected = 'linesep' + os.linesep + 'LF\nLF\nCR\rCRLF\r\n'
self.assertEqual(txt.detach().getvalue().decode('ascii'), expected)
+ 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 MemviewBytesIO(io.BytesIO):
'''A BytesIO object whose read method returns memoryviews