mirror of
https://github.com/python/cpython.git
synced 2025-09-27 02:39:58 +00:00
#3205: bz2 iterator fails silently on MemoryError
This commit is contained in:
parent
59ce901a20
commit
016b366df4
2 changed files with 4 additions and 0 deletions
|
@ -12,6 +12,9 @@ What's New in Python 2.6 beta 3?
|
||||||
Core and Builtins
|
Core and Builtins
|
||||||
-----------------
|
-----------------
|
||||||
|
|
||||||
|
- Issue #3205: When iterating over a BZ2File fails allocating memory, raise
|
||||||
|
a MemoryError rather than silently stop the iteration.
|
||||||
|
|
||||||
- Issue #1481296: Make long(float('nan')) and int(float('nan')) raise
|
- Issue #1481296: Make long(float('nan')) and int(float('nan')) raise
|
||||||
ValueError consistently across platforms.
|
ValueError consistently across platforms.
|
||||||
|
|
||||||
|
|
|
@ -416,6 +416,7 @@ Util_ReadAhead(BZ2FileObject *f, int bufsize)
|
||||||
return 0;
|
return 0;
|
||||||
}
|
}
|
||||||
if ((f->f_buf = PyMem_Malloc(bufsize)) == NULL) {
|
if ((f->f_buf = PyMem_Malloc(bufsize)) == NULL) {
|
||||||
|
PyErr_NoMemory();
|
||||||
return -1;
|
return -1;
|
||||||
}
|
}
|
||||||
Py_BEGIN_ALLOW_THREADS
|
Py_BEGIN_ALLOW_THREADS
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue