Skip to content
Projects
Groups
Snippets
Help
Loading...
Help
Support
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
C
cpython
Project overview
Project overview
Details
Activity
Releases
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Issues
0
Issues
0
List
Boards
Labels
Milestones
Merge Requests
0
Merge Requests
0
Analytics
Analytics
Repository
Value Stream
Wiki
Wiki
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Create a new issue
Commits
Issue Boards
Open sidebar
Kirill Smelkov
cpython
Commits
c44057df
Commit
c44057df
authored
Jan 03, 2013
by
Victor Stinner
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB
parent
549d465f
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
13 additions
and
2 deletions
+13
-2
Misc/NEWS
Misc/NEWS
+2
-0
Modules/_io/fileio.c
Modules/_io/fileio.c
+11
-2
No files found.
Misc/NEWS
View file @
c44057df
...
...
@@ -10,6 +10,8 @@ What's New in Python 3.2.4
Core and Builtins
-----------------
- Issue #16367: Fix FileIO.readall() on Windows for files larger than 2 GB.
- Issue #16455: On FreeBSD and Solaris, if the locale is C, the
ASCII/surrogateescape codec is now used, instead of the locale encoding, to
decode the command line arguments. This change fixes inconsistencies with
...
...
Modules/_io/fileio.c
View file @
c44057df
...
...
@@ -558,7 +558,7 @@ fileio_readall(fileio *self)
{
PyObject
*
result
;
Py_ssize_t
total
=
0
;
in
t
n
;
Py_ssize_
t
n
;
if
(
self
->
fd
<
0
)
return
err_closed
();
...
...
@@ -591,9 +591,18 @@ fileio_readall(fileio *self)
}
Py_BEGIN_ALLOW_THREADS
errno
=
0
;
n
=
newsize
-
total
;
#if defined(MS_WIN64) || defined(MS_WINDOWS)
if
(
n
>
INT_MAX
)
n
=
INT_MAX
;
n
=
read
(
self
->
fd
,
PyBytes_AS_STRING
(
result
)
+
total
,
(
int
)
n
);
#else
n
=
read
(
self
->
fd
,
PyBytes_AS_STRING
(
result
)
+
total
,
newsize
-
total
);
n
);
#endif
Py_END_ALLOW_THREADS
if
(
n
==
0
)
break
;
...
...
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment