classification
Title: io.FileIO.readall() is not 64-bit safe on Windows
Type: Stage:
Components: Library (Lib) Versions: Python 3.4, Python 3.2, Python 3.3, Python 2.7
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: haypo, pitrou, python-dev
Priority: normal Keywords: patch

Created on 2012-10-30 23:43 by haypo, last changed 2013-01-03 02:43 by haypo. This issue is now closed.

Files
File name Uploaded Description Edit
fileio_readall.patch haypo, 2012-10-30 23:43 review
Messages (4)
msg174244 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2012-10-30 23:43
The changeset 374dc910db33 fixed FileIO.readinto(), FileIO.write() and os.write() on Windows for issues #9015, #9611, but FileIO.readall() was not fixed and it has a similar bug.

It uses "int n;" to store the result of read(), so FileIO.readall() may also fail to read a file longer than 2 GB on other platforms.

Attached patch should fix both issues.
msg174360 - (view) Author: Antoine Pitrou (pitrou) * (Python committer) Date: 2012-10-31 19:58
Looks ok to me. Perhaps we could add a bigmem test for that (in test_fileio)?
msg178904 - (view) Author: Roundup Robot (python-dev) Date: 2013-01-03 02:42
New changeset 9aba9ad6c15b by Victor Stinner in branch '3.2':
Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB
http://hg.python.org/cpython/rev/9aba9ad6c15b

New changeset 5f96e4619ceb by Victor Stinner in branch '3.3':
(Merge 3.2) Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
http://hg.python.org/cpython/rev/5f96e4619ceb

New changeset d81d4b3059e4 by Victor Stinner in branch 'default':
(Merge 3.3) Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
http://hg.python.org/cpython/rev/d81d4b3059e4

New changeset f26c91bf61bf by Victor Stinner in branch '2.7':
Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB
http://hg.python.org/cpython/rev/f26c91bf61bf
msg178905 - (view) Author: STINNER Victor (haypo) * (Python committer) Date: 2013-01-03 02:43
> Perhaps we could add a bigmem test for that (in test_fileio)?

Well, I'm too lazy to write such test. Instead of leaving the issue open for weeks, I prefer to commit my patch with no new test (sorry!).
History
Date User Action Args
2013-01-03 02:43:49hayposetstatus: open -> closed
resolution: fixed
messages: + msg178905
2013-01-03 02:42:54python-devsetnosy: + python-dev
messages: + msg178904
2012-10-31 19:58:29pitrousetmessages: + msg174360
2012-10-30 23:43:07haypocreate