summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_io.py
diff options
context:
space:
mode:
authorZackery Spytz <zspytz@gmail.com>2018-06-29 19:30:07 (GMT)
committerSerhiy Storchaka <storchaka@gmail.com>2018-06-29 19:30:07 (GMT)
commitd6a283b37b66ecd2d0ff43602ddc8e91b54a51c5 (patch)
tree80de5b2d05753476ff76a50de7bae64bd94db84b /Lib/test/test_io.py
parenta73027918a659ca69480a7e023d3838e2601ce6d (diff)
downloadcpython-d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5.zip
cpython-d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5.tar.gz
cpython-d6a283b37b66ecd2d0ff43602ddc8e91b54a51c5.tar.bz2
[3.6] bpo-25862: Fix assertion failures in io.TextIOWrapper.tell(). (GH-3918). (GH-8012)
(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 0b5b033..88fd6ce 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -3348,6 +3348,17 @@ class TextIOWrapperTest(unittest.TestCase):
F.tell = lambda x: 0
t = self.TextIOWrapper(F(), encoding='utf-8')
+ 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