[Python-3000-checkins] r61461 - in python/branches/py3k: Lib/io.py Lib/test/test_io.py Misc/ACKS Misc/NEWS

ka-ping.yee python-3000-checkins at python.org
Mon Mar 17 21:36:09 CET 2008


Author: ka-ping.yee
Date: Mon Mar 17 21:35:15 2008
New Revision: 61461

Modified:
   python/branches/py3k/Lib/io.py
   python/branches/py3k/Lib/test/test_io.py
   python/branches/py3k/Misc/ACKS
   python/branches/py3k/Misc/NEWS
Log:
Patch from jbalogh fixes issue #2282 (misnamed seekable() method).


Modified: python/branches/py3k/Lib/io.py
==============================================================================
--- python/branches/py3k/Lib/io.py	(original)
+++ python/branches/py3k/Lib/io.py	Mon Mar 17 21:35:15 2008
@@ -1203,7 +1203,7 @@
     # 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):

Modified: python/branches/py3k/Lib/test/test_io.py
==============================================================================
--- python/branches/py3k/Lib/test/test_io.py	(original)
+++ python/branches/py3k/Lib/test/test_io.py	Mon Mar 17 21:35:15 2008
@@ -895,6 +895,12 @@
         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")()

Modified: python/branches/py3k/Misc/ACKS
==============================================================================
--- python/branches/py3k/Misc/ACKS	(original)
+++ python/branches/py3k/Misc/ACKS	Mon Mar 17 21:35:15 2008
@@ -33,6 +33,7 @@
 Stig Bakken
 Greg Ball
 Luigi Ballabio
+Jeff Balogh
 Michael J. Barber
 Chris Barker
 Quentin Barnes

Modified: python/branches/py3k/Misc/NEWS
==============================================================================
--- python/branches/py3k/Misc/NEWS	(original)
+++ python/branches/py3k/Misc/NEWS	Mon Mar 17 21:35:15 2008
@@ -30,6 +30,8 @@
 Core and Builtins
 -----------------
 
+- Issue #2282: io.TextIOWrapper was not overriding seekable() from io.IOBase.
+
 - Issue #2115: Important speedup in setting __slot__ attributes.  Also 
   prevent a possible crash: an Abstract Base Class would try to access a slot 
   on a registered virtual subclass.


More information about the Python-3000-checkins mailing list