classification
Title: TextIOWrapper.seekable() always returns False
Type: enhancement Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: ping Nosy List: gvanrossum, jeff.balogh, netzhen, ping
Priority: high Keywords: patch

Created on 2008-03-13 04:32 by netzhen, last changed 2008-03-17 20:35 by ping. This issue is now closed.

Files
File name Uploaded Description Edit
issue2282.diff jeff.balogh, 2008-03-17 15:59 Fixes the seekable method and adds a test.
Messages (4)
msg63494 - (view) Author: zhen (netzhen) Date: 2008-03-13 04:32
The seekable() method of TextIOWrapper always returns False, for it 
does't override the seekable method of IOBase class in which just 
returns False. But, there is a method named _seekable(self) in 
TextIOWrapper(in io.py line 1211):
     def _seekable(self):
        return self._seekable
which should be seekable(self), and _seekable method is overwrited by 
line 1190 in the __init__ method as a bool object:
    self._seekable = self._telling = self.buffer.seekable()
msg63660 - (view) Author: Jeff Balogh (jeff.balogh) * Date: 2008-03-17 15:59
Attaching a patch that fixes this issue and adds a regression test.
msg63663 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2008-03-17 16:15
Confirmed.  Ping, since you're looking at io.py anyway, can you fix this
too?
msg63762 - (view) Author: Ka-Ping Yee (ping) * (Python committer) Date: 2008-03-17 20:35
Patch committed.
History
Date User Action Args
2008-03-17 20:35:52pingsetstatus: open -> closed
resolution: accepted
messages: + msg63762
2008-03-17 16:15:27gvanrossumsetpriority: high
assignee: ping
messages: + msg63663
nosy: + ping
2008-03-17 16:02:24benjamin.petersonsetnosy: + gvanrossum
2008-03-17 15:59:43jeff.baloghsetfiles: + issue2282.diff
nosy: + jeff.balogh
messages: + msg63660
keywords: + patch
2008-03-13 04:32:29netzhencreate