From: Christian Heimes Date: Sun, 2 Dec 2012 06:56:42 +0000 (+0100) Subject: Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation failure X-Git-Tag: v3.4.0a1~1923 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=5f7e8dab11cab6a19a454ee7d3567e5f61a4e43c;p=python Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation failure --- diff --git a/Misc/NEWS b/Misc/NEWS index 739a5eac7d..11a313f6aa 100644 --- a/Misc/NEWS +++ b/Misc/NEWS @@ -10,6 +10,9 @@ What's New in Python 3.4.0 Alpha 1? Core and Builtins ----------------- +- Issue #16592: stringlib_bytes_join doesn't raise MemoryError on allocation + failure. + - Issue #16546: Fix: ast.YieldFrom argument is now mandatory. - Issue #16514: Fix regression causing a traceback when sys.path[0] is None diff --git a/Objects/stringlib/join.h b/Objects/stringlib/join.h index d1d6e532c5..5568b31dab 100644 --- a/Objects/stringlib/join.h +++ b/Objects/stringlib/join.h @@ -43,6 +43,7 @@ STRINGLIB(bytes_join)(PyObject *sep, PyObject *iterable) buffers = PyMem_NEW(Py_buffer, seqlen); if (buffers == NULL) { Py_DECREF(seq); + PyErr_NoMemory(); return NULL; } }