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
ed02eb6a
Commit
ed02eb6a
authored
Mar 31, 2006
by
Georg Brandl
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Bug #1177964: make file iterator raise MemoryError on too big files
parent
644b1e7a
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
with
2 additions
and
1 deletion
+2
-1
Objects/fileobject.c
Objects/fileobject.c
+2
-1
No files found.
Objects/fileobject.c
View file @
ed02eb6a
...
...
@@ -1797,7 +1797,7 @@ drop_readahead(PyFileObject *f)
/* Make sure that file has a readahead buffer with at least one byte
(unless at EOF) and no more than bufsize. Returns negative value on
error */
error
, will set MemoryError if bufsize bytes cannot be allocated.
*/
static
int
readahead
(
PyFileObject
*
f
,
int
bufsize
)
{
...
...
@@ -1810,6 +1810,7 @@ readahead(PyFileObject *f, int bufsize)
drop_readahead
(
f
);
}
if
((
f
->
f_buf
=
PyMem_Malloc
(
bufsize
))
==
NULL
)
{
PyErr_NoMemory
();
return
-
1
;
}
Py_BEGIN_ALLOW_THREADS
...
...
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