Benjamin Peterson
c3e10c237b
merge 3.3
2013-07-21 13:29:42 -07:00
Benjamin Peterson
0f9b7d32c7
fix spacing
2013-07-21 13:29:37 -07:00
Benjamin Peterson
33113a3504
merge 3.3
2013-07-21 13:26:27 -07:00
Benjamin Peterson
04b01dc8f7
let's not return NULL from functions that should return ints
2013-07-21 13:26:13 -07:00
Victor Stinner
d786ad55ef
Issue #18520 : Fix initsigs(), handle PyOS_InitInterrupts() error
...
PyOS_InitInterrupts() can raise error when importing the signal module
2013-07-21 13:25:51 +02:00
Christian Heimes
02e8b53e6d
Check return value of lseek() in _Py_DisplaySourceLine().
...
Also use portable SEEK_SET instead of 0.
CID 1040639
2013-07-21 02:12:44 +02:00
Christian Heimes
1f34729f42
Check return value of lseek() in _Py_DisplaySourceLine().
...
Also use portable SEEK_SET instead of 0.
CID 1040639
2013-07-21 02:12:35 +02:00
Christian Heimes
8282d749a6
Check return value of PyObject_AsFileDescriptor() in _Py_DisplaySourceLine() for error
...
CID 486768
2013-07-21 01:53:18 +02:00
Christian Heimes
8c077bc03e
Check return value of PyObject_AsFileDescriptor() in _Py_DisplaySourceLine() for error
...
CID 486768
2013-07-21 01:53:10 +02:00
Christian Heimes
7bc80fcf4e
Check return value of fstat() in _PyImport_GetDynLoadFunc()
...
CID 486250
2013-07-20 22:18:19 +02:00
Christian Heimes
27c4c3ec79
Check return value of fstat() in _PyImport_GetDynLoadFunc()
...
CID 486250
2013-07-20 22:17:55 +02:00
Christian Heimes
74ba26a40c
Add missing check of PyDict_SetItem()'s return value in _PyImport_FindExtensionObject()
...
CID 486649
2013-07-20 14:52:18 +02:00
Christian Heimes
09ca794afe
Add missing check of PyDict_SetItem()'s return value in _PyImport_FindExtensionObject()
...
CID 486649
2013-07-20 14:51:53 +02:00
Christian Heimes
895bdfb16e
Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
...
CID 486647
2013-07-20 14:48:21 +02:00
Christian Heimes
0bd447f847
Add missing check of PyDict_SetItem()'s return value in PyEval_EvalCodeEx()
...
CID 486647
2013-07-20 14:48:10 +02:00
Victor Stinner
ace47d7efd
Issue #18408 : PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now fail
...
with an assertion error if they are called with an exception set
(PyErr_Occurred()).
If these functions are called with an exception set, the exception may be
cleared and so the caller looses its exception.
Add also assertions to PyEval_CallObjectWithKeywords() and call_function() to
check if the function succeed with no exception set, or the function failed
with an exception set.
2013-07-18 01:41:08 +02:00
Victor Stinner
479054bca7
Issue #18408 : Fix PyErr_SetImportError(), handle PyDict_SetItemString() failure
2013-07-17 21:54:25 +02:00
Victor Stinner
8e54b1c448
Issue #18408 : Fix _PyImport_LoadDynamicModule(), handle PyUnicode_FromFormat() failure
2013-07-17 21:53:23 +02:00
Victor Stinner
0fae8f9083
Issue #18408 : Fix ast_for_atom(), PyErr_Fetch(&type, &value, &tback) can set value to NULL
2013-07-17 21:51:42 +02:00
Victor Stinner
26f91999b4
Close #18469 : Replace PyDict_GetItemString() with _PyDict_GetItemId() in structseq.c
...
_PyDict_GetItemId() is more efficient: it only builds the Unicode string once.
Identifiers (dictionary keys) are now created at Python initialization, and if
the creation failed, Python does exit with a fatal error.
Before, PyDict_GetItemString() failure was not handled: structseq_new() could
call PyObject_GC_NewVar() with a negative size, and structseq_dealloc() could
also crash.
2013-07-17 01:22:45 +02:00
Victor Stinner
43d8195a70
Issue #18408 : Handle PyArena_AddPyObject() failure in ast.c
...
PyList_Append() (called by PyArena_AddPyObject()) can fail because of a
MemoryError for example.
2013-07-17 00:57:58 +02:00
Victor Stinner
74a7fa6663
Issue #18408 : Fix PyErr_NormalizeException(), handle PyObject_IsSubclass() failure
...
PyObject_IsSubclass() can fail and raise a new exception!
2013-07-17 00:44:53 +02:00
Victor Stinner
bdf630c4a7
Issue #18408 : Fix Python-ast.c: handle init_types() failure (ex: MemoryError)
2013-07-17 00:17:15 +02:00
Victor Stinner
1e53bbaced
Issue #18408 : handle PySys_GetObject() failure, raise a RuntimeError
2013-07-16 22:26:05 +02:00
Victor Stinner
78e2c985ac
Issue #18408 : Fix show_warning(), clear also the exception raised by
...
_Py_DisplaySourceLine()
For example, _PyGC_DumpShutdownStats() calls PyErr_WarnExplicitFormat() while
the import machinery does not work anymore, _Py_DisplaySourceLine() fails when
trying to import the io module.
2013-07-16 01:54:37 +02:00
Victor Stinner
f243ee4055
Issue #18408 : add more assertions on PyErr_Occurred() in ceval.c to detect bugs
...
earlier
2013-07-16 01:02:12 +02:00
Victor Stinner
ceceaa00ba
Issue #18408 : Fix _Py_DisplaySourceLine()
...
Report _Py_FindSourceFile() error, so the error is cleared;
and clear io.open(filename) exception on failure.
2013-07-16 00:32:14 +02:00
Victor Stinner
7eab0d000c
Issue #18408 : Fix PyEval_EvalFrameEx() for MemoryError
...
Don't pass a NULL traceback to PyException_SetTraceback(): pass Py_None.
Passing NULL would raise a new exception.
2013-07-15 21:16:27 +02:00
Brett Cannon
a79e4fb38d
Issue #18342 : Use the repr of a module name for ``from ... import
...
...`` when an ImportError occurs.
Other cases had already been switched over to using the repr.
Thanks to Tomasz Maćkowiak for the patch.
2013-07-12 11:22:26 -04:00
Brett Cannon
f0cb69274c
Issue #18415 : Normalize what type of quotes are used with string
...
constants in importlib._bootstrap. Along the way clean up from string
interpolation to use the repr explicitly.
Initial patch by Madison May.
2013-07-12 11:04:23 -04:00
Victor Stinner
fb3a630001
Issue #18408 : errors.c: in debug mode, calling PyErr_BadInternalCall() now
...
fails with an assertion error
2013-07-12 00:37:30 +02:00
Victor Stinner
365b693adc
Issue #18408 : ceval.c: in debug mode, convert the PyErr_Occurred() check on
...
exception (when getting NULL) to an assertion to detect bugs earlier
2013-07-12 00:11:58 +02:00
Victor Stinner
cc35159ed8
Issue #18408 : normalizestring() now raises MemoryError on memory allocation failure
2013-07-12 00:02:55 +02:00
Victor Stinner
6b64a6803e
Issue #18408 : Fix compiler_import() to handle PyUnicode_Substring() failure properly
2013-07-11 22:50:45 +02:00
Victor Stinner
9a4fb66966
Issue #18408 : ste_new() initialize all attributes before handling error
...
If an attribute is not initialized, the destructor can crash
2013-07-11 22:49:00 +02:00
Serhiy Storchaka
f9e6672ae8
Issue #17872 : Fix a segfault in marshal.load() when input stream returns
...
more bytes than requested.
2013-07-11 22:28:18 +03:00
Serhiy Storchaka
3641a74e1c
Issue #17872 : Fix a segfault in marshal.load() when input stream returns
...
more bytes than requested.
2013-07-11 22:20:47 +03:00
Serhiy Storchaka
a155d40ed5
Fix reference leaks introduced by the patch for issue #5308 .
2013-07-11 19:19:47 +03:00
Serhiy Storchaka
dfde2151ed
Fix reference leaks introduced by the patch for issue #5308 .
2013-07-11 19:14:26 +03:00
Christian Heimes
6cee994674
Issue #18426 : improve exception message. Courtesy of Amaury
2013-07-11 13:02:37 +02:00
Christian Heimes
7ce57d67c9
Issue #18426 : improve exception message. Courtesy of Amaury
2013-07-11 13:02:30 +02:00
Christian Heimes
5ec44649df
Issue #18426 : Fix NULL pointer dereference in C extension import when
...
PyModule_GetDef() returns an error.
2013-07-11 11:23:34 +02:00
Christian Heimes
848ee099f5
Issue #18426 : Fix NULL pointer dereference in C extension import when
...
PyModule_GetDef() returns an error.
2013-07-11 11:22:21 +02:00
R David Murray
acb362e29f
Merge: #18424 : PEP8ify the tense of the sum docstring.
2013-07-10 16:22:59 -04:00
R David Murray
87ead1138d
#18424 : PEP8ify the tense of the sum docstring.
2013-07-10 16:22:14 -04:00
Victor Stinner
aaa8ed8b84
Issue #18408 : Fix call_exc_trace(): if the traceback is NULL, use None when
...
building the tuple (type, value, traceback) passed to the callback.
PyTuple_Pack() does crash if an argument is NULL.
2013-07-10 13:57:55 +02:00
Victor Stinner
e0af3a802a
Issue #18408 : Fix PyCode_Optimize(): raise a MemoryError on memory allocation
...
failure.
2013-07-09 00:32:04 +02:00
Victor Stinner
0ff0f54dd4
Issue #18408 : Fix call_function() of ceval.c to handle PyTuple_New() failure
...
(in load_args()), ex: MemoryError.
2013-07-08 22:27:42 +02:00
Victor Stinner
3a8b79d4d2
Issue #18408 : Fix marshal reader for Unicode strings: handle
...
PyUnicode_DecodeUTF8() failure (ex: MemoryError).
2013-07-08 22:23:32 +02:00
Victor Stinner
49fc8ece81
Issue #18203 : Add _PyMem_RawStrdup() and _PyMem_Strdup()
...
Replace strdup() with _PyMem_RawStrdup() or _PyMem_Strdup(), depending if the
GIL is held or not.
2013-07-07 23:30:24 +02:00