[Python-Dev] cpython: Issue #18408: Fix PyUnicode_AsUTF8AndSize(), raise MemoryError exception on

Georg Brandl g.brandl at gmx.net
Tue Oct 29 07:54:32 CET 2013


Am 29.10.2013 01:46, schrieb victor.stinner:
> http://hg.python.org/cpython/rev/e1d51c42e5a1
> changeset:   86716:e1d51c42e5a1
> user:        Victor Stinner <victor.stinner at gmail.com>
> date:        Tue Oct 29 01:28:23 2013 +0100
> summary:
>   Issue #18408: Fix PyUnicode_AsUTF8AndSize(), raise MemoryError exception on
> memory allocation failure
> 
> files:
>   Objects/unicodeobject.c |  1 +
>   1 files changed, 1 insertions(+), 0 deletions(-)
> 
> 
> diff --git a/Objects/unicodeobject.c b/Objects/unicodeobject.c
> --- a/Objects/unicodeobject.c
> +++ b/Objects/unicodeobject.c
> @@ -3766,6 +3766,7 @@
>              return NULL;
>          _PyUnicode_UTF8(unicode) = PyObject_MALLOC(PyBytes_GET_SIZE(bytes) + 1);
>          if (_PyUnicode_UTF8(unicode) == NULL) {
> +            PyErr_NoMemory();
>              Py_DECREF(bytes);
>              return NULL;
>          }

Shouldn't this (and related commits from #18408) have been committed to the 3.3
branch?

Georg



More information about the Python-Dev mailing list