BPO | [5016](https://bugs.python.org/issue5016) --- | :--- Nosy | @pitrou, @vstinner Files | [fileio_seekable-trunk-2.patch](https://bugs.python.org/file13433/fileio_seekable-trunk-2.patch "Uploaded as text/plain at 2009-03-27.01:21:30 by @vstinner") *Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.* Show more details GitHub fields: ```python assignee = None closed_at = created_at = labels = ['extension-modules', 'type-bug'] title = 'FileIO.seekable() can return False' updated_at = user = 'https://github.com/pitrou' ``` bugs.python.org fields: ```python activity = actor = 'vstinner' assignee = 'none' closed = True closed_date = closer = 'vstinner' components = ['Extension Modules'] creation = creator = 'pitrou' dependencies = [] files = ['13433'] hgrepos = [] issue_num = 5016 keywords = ['patch'] message_count = 9.0 messages = ['80295', '80301', '80302', '80474', '83545', '84238', '84241', '84246', '116059'] nosy_count = 2.0 nosy_names = ['pitrou', 'vstinner'] pr_nums = [] priority = 'normal' resolution = 'fixed' stage = 'resolved' status = 'closed' superseder = None type = 'behavior' url = 'https://bugs.python.org/issue5016' versions = ['Python 2.7'] ```
Activity
pitrou commentedon Jan 20, 2009
FileIO.seekable() can return False if we first seek to a position such
that, when truncated to a signed int, it becomes negative:
vstinner commentedon Jan 21, 2009
Patch with regression test in test_largefile: test 2**31-1, 2**31,
2**31+1.
vstinner commentedon Jan 21, 2009
See also issue bpo-5008.
vstinner commentedon Jan 24, 2009
Woops, I attached the wrong patch!
pitrou commentedon Mar 13, 2009
Committed in r70352 (py3k), r70353 (3.0). Needs backport to trunk and
2.6, if someone is interested.
vstinner commentedon Mar 27, 2009
I'm interrested by a backport at least in trunk. I updated the patch
to trunk:
Python trunk, a file has no seekable() method :-/
API (not __exit__() method)
pitrou commentedon Mar 27, 2009
You can use io.open() instead of open()...
vstinner commentedon Mar 27, 2009
Alright, it's much easier with io.open() :-)
vstinner commentedon Sep 10, 2010
It is fixed in 2.7 with the backport of the Python3's io library (r73394).