[Python-Dev] CALL_ATTR patch

Michael Hudson mwh at python.net
Thu Aug 7 17:34:57 EDT 2003


Michael Hudson <mwh at python.net> writes:

> On Friday, Apr 18, 2003, at 01:22 Europe/London, Guido van Rossum wrote:
>
> Note that this is quite some time ago :-)  I've been reading through
> some messages that have been ticked for rather too long in my
> python-dev mail folder...
>
>>> (Looking at PyObject_GenericGetAttr with that in mind, I wonder if
>>> there isn't a possible crash there. In the first MRO lookup, looking
>>> for descr's, if a non-data-descr is found, it is kept around but not
>>> INCREF'd until later, after the instance-dict is searched. Am I
>>> wrong in believing the PyDict_GetItem of the instance dict can call
>>> Python code ?
[..]
>> Fixing this would make the code even hairier though... :-(
>
> Pff, it's not so bad, just a little refcount code jiggling.  I'll make
> a real patch including the above test case soon (once I'm reasonably
> confident that I'm not leaking references).

http://www.python.org/sf/784825

Cheers,
mwh

-- 
  ... with these conditions cam the realisation that ... nothing
  turned a perfectly normal healthy individual into a great political
  or military leader better than irreversible brain damage.
                   -- The Hitch-Hikers Guide to the Galaxy, Episode 11



More information about the Python-Dev mailing list