[issue12946] PyModule_GetDict() claims it can never fail, but it can

2011-09-09 Thread Stefan Behnel
New submission from Stefan Behnel : As is obvious from the code, PyModule_GetDict() can fail if being passed a non-module object, and when the (unlikely) dict creation at the end fails. The documentation of the C-API function should be fixed to reflect that, i.e. it should state that NULL is r

[issue12946] PyModule_GetDict() claims it can never fail, but it can

2011-09-12 Thread Amaury Forgeot d'Arc
Amaury Forgeot d'Arc added the comment: The path with PyDict_New() is never taken, because PyModule_New already fills md_dict. -- nosy: +amaury.forgeotdarc ___ Python tracker _

[issue12946] PyModule_GetDict() claims it can never fail, but it can

2011-09-13 Thread STINNER Victor
STINNER Victor added the comment: So, can we close this issue? -- nosy: +haypo ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue12946] PyModule_GetDict() claims it can never fail, but it can

2011-09-13 Thread Stefan Behnel
Stefan Behnel added the comment: I gave two reasons why this function can fail, and one turns out to be assumed-to-be-dead code. So, no, there are two issues now, one with the documentation, one with the code. -- ___ Python tracker