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 pitrou
Recipients ezio.melotti, maliubiao@gmail.com, pitrou
Date 2014-03-16.17:15:21
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1394990122.25.0.235866092065.issue20945@psf.upfronthosting.co.za>
In-reply-to
Content
> olditem is not useful

It is. Py_XDECREF() may have massive side effects (such as calling a __del__ method and executing arbitrary code). Therefore, you have to ensure that the tuple item is set to the new value *before* the old value is DECREF'ed. Otherwise, any code invoked by Py_XDECREF will see invalid tuple contents, and the interpreter may crash.
History
Date User Action Args
2014-03-16 17:15:22pitrousetrecipients: + pitrou, ezio.melotti, maliubiao@gmail.com
2014-03-16 17:15:22pitrousetmessageid: <1394990122.25.0.235866092065.issue20945@psf.upfronthosting.co.za>
2014-03-16 17:15:22pitroulinkissue20945 messages
2014-03-16 17:15:21pitroucreate