summaryrefslogtreecommitdiffstats
path: root/Lib
diff options
context:
space:
mode:
Diffstat (limited to 'Lib')
-rw-r--r--Lib/io.py2
-rw-r--r--Lib/test/test_io.py6
2 files changed, 7 insertions, 1 deletions
diff --git a/Lib/io.py b/Lib/io.py
index 24bf37b..98843d3 100644
--- a/Lib/io.py
+++ b/Lib/io.py
@@ -1203,7 +1203,7 @@ class TextIOWrapper(TextIOBase):
# were rendered by the decoder after feeding it those bytes. We
# use this to reconstruct intermediate decoder states in tell().
- def _seekable(self):
+ def seekable(self):
return self._seekable
def flush(self):
diff --git a/Lib/test/test_io.py b/Lib/test/test_io.py
index 4963416..0bc2b48 100644
--- a/Lib/test/test_io.py
+++ b/Lib/test/test_io.py
@@ -895,6 +895,12 @@ class TextIOWrapperTest(unittest.TestCase):
txt.seek(pos)
self.assertEquals(txt.read(4), "BBB\n")
+ def test_issue2282(self):
+ buffer = io.BytesIO(self.testdata)
+ txt = io.TextIOWrapper(buffer, encoding="ascii")
+
+ self.assertEqual(buffer.seekable(), txt.seekable())
+
def test_newline_decoder(self):
import codecs
decoder = codecs.getincrementaldecoder("utf-8")()