Eugene Kapun <abacabadabac...@gmail.com> added the comment:

Actually, this can't be fixed without modifying C API methods PyArg_ParseTuple 
and PyArg_ParseTupleAndKeywords, because it's possible to make an object 
deallocated before PyArg_ParseTuple returns, so Py_INCREF immediately after 
parsing would be already too late.

Here are my test cases:
test-resource.py - in Modules/resource.c, and python-bug-01.patch won't work 
against it.
test-ctypes.py - in Modules/_ctypes/_ctypes.c.
test-functools.py - in Modules/_functoolsmodule.c (py3k only).

----------
components: +Interpreter Core -Extension Modules
nosy: +abacabadabacaba
title: Reference counting bug in setrlimit -> Reference counting bug in 
PyArg_ParseTuple and PyArg_ParseTupleAndKeywords
Added file: http://bugs.python.org/file19616/test-resource.py

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

Reply via email to