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 2008年06月26日 09:08 by mdehoon, last changed 2022年04月11日 14:56 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| bz2module.c.patch | mdehoon, 2008年06月26日 09:08 | Patch to Modules/bz2module.c | ||
| Messages (2) | |||
|---|---|---|---|
| msg68770 - (view) | Author: Michiel de Hoon (mdehoon) * | Date: 2008年06月26日 09:08 | |
PyMem_Malloc is called in the Util_ReadAhead function in bz2module.c.
The code checks if PyMem_Malloc returns NULL, but in that case no
MemoryError is raised. So, if in the following code:
>>> input = bz2.BZ2File("myfile.txt.bz2")
>>> for line in input:
... # do something with the line
Python runs out of memory during the for-loop, then the for-loop exits
without an Exception being raised. To the user, it appears that the end
of the myfile.txt.bz2 file was reached and that no error occurred.
In the attached patch, I call PyErr_NoMemory() if PyMem_Malloc fails.
This then raises the MemoryError exception as appropriate.
|
|||
| msg70939 - (view) | Author: Antoine Pitrou (pitrou) * (Python committer) | Date: 2008年08月09日 17:22 | |
Fixed in r65609. Thanks for the report and for the patch! |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:56:35 | admin | set | github: 47455 |
| 2008年08月09日 17:22:54 | pitrou | set | status: open -> closed resolution: fixed messages: + msg70939 nosy: + pitrou |
| 2008年06月26日 09:08:20 | mdehoon | create | |