wr-web opened a new issue, #49915:
URL: https://github.com/apache/arrow/issues/49915

   
   Remove incorrect Py_XDECREF call for `item`.
   
   ### Related Code
   
   
https://github.com/apache/arrow/blob/060062178ca85fa2d7dbd4083574bca6f91cc44c/python/pyarrow/src/arrow/python/numpy_convert.cc#L396-L398
   
   
https://github.com/apache/arrow/blob/060062178ca85fa2d7dbd4083574bca6f91cc44c/python/pyarrow/src/arrow/python/numpy_convert.cc#L404-L406
   
   [PyList_SetItem Source 
Code](https://github.com/python/cpython/blob/a126893fa80c4ee5f0bac8a84a49491c19edd511/Objects/listobject.c#L454)
   
   [PyList_SetItem 
Document](https://docs.python.org/3/c-api/list.html#c.PyList_SetItem)
   
   [PyList_SetItem Python Forum 
Discussion](https://discuss.python.org/t/proper-handling-of-pylist-setitem-return-value-and-reference-stealing-in-cpython-c-extensions/105805)
   
   Therefore, whether the function succeeds or fails, it will steal a reference 
count of the third argument. It must not call `Py_XDECREF` in case of failure.
   
   Similar issue/PR:
   
   https://github.com/PaddlePaddle/Paddle/issues/77447
   
   https://github.com/apache/geaflow/pull/725


-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: [email protected]

For queries about this service, please contact Infrastructure at:
[email protected]

Reply via email to