[Python-Dev] Fw: Behavior of buffer()

Scott Gilbert xscottg@yahoo.com
Thu, 18 Jul 2002 12:24:50 -0700 (PDT)


--- Guido van Rossum <guido@python.org> wrote:
> > Yes.  The PyBufferObject grabs the pointer from the PyBufferProcs
> > supporting object when the PyBufferObject is created.  If the
> > PyBufferProcs supporting object reallocates the memory (possibly 
> > from a resize) the PyBufferObject can be left with a bad pointer.
> > This is easily possible if you try to use the array module arrays 
> > as a buffer.
> > 
> > I've submitted a patch to fix this particular problem (among others),
> > but there are still enough things that the buffer object can't do that
> > something new is needed.
> 
> Can you remind me of the patch#?  (I'm curious how you plan to fix
> this...)
> 

Patch number 552438.

Instead of cacheing the pointer, it grabs it from the other object every
time it is needed.  Might be a little slower, but I think it's correct.


> Barry (the PEP czar) forwarded me your PEP.  I'll try to do some
> triage on it so I can tell Barry whether to check it in (that doesn't
> mean it's accepted :-).

<chuckle> I'm bad at patience, but I'm not terribly naive.  I fully expect
everyone and their dog will find something to dislike before it gets
approved/rejected.


Cheers,
    -Scott


__________________________________________________
Do You Yahoo!?
Yahoo! Autos - Get free new car price quotes
http://autos.yahoo.com