This issue tracker has been migrated to GitHub ,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2009年01月20日 23:38 by pitrou, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| fileio_seekable-trunk-2.patch | vstinner, 2009年03月27日 01:21 | |||
| Messages (9) | |||
|---|---|---|---|
| msg80295 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年01月20日 23:38 | |
FileIO.seekable() can return False if we first seek to a position such
that, when truncated to a signed int, it becomes negative:
>>> f = open('largefile', 'wb', buffering=0)
>>> f.seek(2**31, 0)
2147483648
>>> f.write(b'x')
1
>>> f.close()
>>> f = open('largefile', 'rb', buffering=0)
>>> f.seek(0, 2)
2147483649
>>> f.seekable()
False
|
|||
| msg80301 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年01月21日 00:38 | |
Patch with regression test in test_largefile: test 2**31-1, 2**31, 2**31+1. |
|||
| msg80302 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年01月21日 00:40 | |
See also issue #5008. |
|||
| msg80474 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年01月24日 19:37 | |
Woops, I attached the wrong patch! |
|||
| msg83545 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年03月13日 23:47 | |
Committed in r70352 (py3k), r70353 (3.0). Needs backport to trunk and 2.6, if someone is interested. |
|||
| msg84238 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年03月27日 00:42 | |
> Needs backport to trunk and 2.6, if someone is interested. I'm interrested by a backport at least in trunk. I updated the patch to trunk: - test directly _file._FileIO() instead of using open() because in Python trunk, a file has no seekable() method :-/ - use contextlib.closing() because _FileIO doesn't implement context API (not __exit__() method) |
|||
| msg84241 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2009年03月27日 00:49 | |
You can use io.open() instead of open()... |
|||
| msg84246 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2009年03月27日 01:21 | |
> You can use io.open() instead of open()... Alright, it's much easier with io.open() :-) |
|||
| msg116059 - (view) | Author: STINNER Victor (vstinner) * (Python committer) | Date: 2010年09月10日 23:22 | |
It is fixed in 2.7 with the backport of the Python3's io library (r73394). |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:44 | admin | set | github: 49266 |
| 2010年09月10日 23:22:08 | vstinner | set | status: open -> closed resolution: accepted -> fixed messages: + msg116059 |
| 2010年08月22日 00:21:09 | georg.brandl | set | versions: - Python 2.6 |
| 2009年03月27日 01:21:40 | vstinner | set | files: - fileio_seekable-trunk.patch |
| 2009年03月27日 01:21:33 | vstinner | set | files:
+ fileio_seekable-trunk-2.patch messages: + msg84246 |
| 2009年03月27日 00:49:33 | pitrou | set | messages: + msg84241 |
| 2009年03月27日 00:42:59 | vstinner | set | files:
+ fileio_seekable-trunk.patch messages: + msg84238 |
| 2009年03月27日 00:41:16 | vstinner | set | files: - fileio_seekable.patch |
| 2009年03月13日 23:47:27 | pitrou | set | priority: high -> normal versions: - Python 3.0, Python 3.1 messages: + msg83545 resolution: accepted stage: needs patch -> resolved |
| 2009年01月24日 19:37:37 | vstinner | set | files:
+ fileio_seekable.patch messages: + msg80474 |
| 2009年01月24日 19:36:09 | vstinner | set | files: - fileio_append.patch |
| 2009年01月21日 00:40:10 | vstinner | set | messages: + msg80302 |
| 2009年01月21日 00:38:52 | vstinner | set | files:
+ fileio_append.patch keywords: + patch messages: + msg80301 nosy: + vstinner |
| 2009年01月20日 23:57:39 | pitrou | set | priority: high stage: needs patch |
| 2009年01月20日 23:38:37 | pitrou | create | |