[issue30081] Inconsistent handling of failure of PyModule_AddObject

2017-04-16 Thread Xiang Zhang
Xiang Zhang added the comment: Ohh, I am not alone. :-) -- resolution: -> duplicate stage: -> resolved status: open -> closed superseder: -> Change weird behavior of PyModule_AddObject() ___ Python tracker _

[issue30081] Inconsistent handling of failure of PyModule_AddObject

2017-04-16 Thread Serhiy Storchaka
Serhiy Storchaka added the comment: This is a duplicate of issue26868 and issue26871. There is also a thread on Python-Dev. -- nosy: +serhiy.storchaka ___ Python tracker ___ ___

[issue30081] Inconsistent handling of failure of PyModule_AddObject

2017-04-16 Thread Xiang Zhang
New submission from Xiang Zhang: The doc of PyModule_AddObject()[1] states it steals a reference to *value*. But this is only the case when it succeed. On failure the reference is not stolen. The usages of it across the code base are inconsistent. Some realizes this situation and depends on it