Uh oh!
There was an error while loading.Please reload this page.
- Notifications
You must be signed in to change notification settings - Fork32.1k
Closed
Description
There are several issues in error handling in the marshal module:
- EOFError can override other errors such as MemoryError or OSError at the start of the object.
- When the NULL object occurs as a code object component, the error message can be misleading (like "NULL object in marshal data for list") or even ignored (if the code object is a dict key) and reading will continue.
Also, it is a common idiom to only call PyErr_Occurred() if the return code denotes a possible error. This is not always used in that code. While the performance gain may be tiny, it is better to get rid of an overhead, it can pay for itself after further optimizations.