This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author rhettinger
Recipients abacabadabacaba, rhettinger
Date 2010-04-18.18:21:39
SpamBayes Score 0.0004289371
Marked as misclassified No
Message-id <1271614901.23.0.143265863856.issue8420@psf.upfronthosting.co.za>
In-reply-to
Content
>Bugs in set_repr:
>> keys = PySequence_List((PyObject *)so);
>> if (keys == NULL)
>> 	goto done;
>> 
>> listrepr = PyObject_Repr(keys);
>> Py_DECREF(keys);
>List pointed to by keys is already deallocated at this point.
>> if (listrepr == NULL) {
>> 	Py_DECREF(keys);
>>But this code tries to DECREF it.
>> 	goto done;
>> }

I don't follow why you think keys is already deallocated.
When assigned by PySequence_List() without a NULL return, the refcnt is one. The call to PyObject_Repr(keys) does not change the refcnt of keys,
so the Py_DECREF(keys) is correct.
History
Date User Action Args
2010-04-18 18:21:41rhettingersetrecipients: + rhettinger, abacabadabacaba
2010-04-18 18:21:41rhettingersetmessageid: <1271614901.23.0.143265863856.issue8420@psf.upfronthosting.co.za>
2010-04-18 18:21:39rhettingerlinkissue8420 messages
2010-04-18 18:21:39rhettingercreate