New submission from STINNER Victor:

If PyDict_New() fails (ex: memory allocation failure), odict_new() returns a 
new OrderedDict with an exception set. It's a bug. Attached patch fixes it.

odict_new() constructor also returns NULL without destroying the newly created 
object if _odict_initialize() fails. My patch also fixes this.

My patch inlines _odict_initialize() into odict_new() and avoids useless 
initialization to 0.

----------
files: odict.patch
keywords: patch
messages: 249625
nosy: eric.snow, haypo
priority: normal
severity: normal
status: open
title: collections.OrderedDict constructor (odict_new) doesn't handle 
PyDict_New() failure
versions: Python 3.6
Added file: http://bugs.python.org/file40334/odict.patch

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue24992>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to