[Patches] [ python-Patches-550551 ] Read/Write buffers from buffer()

noreply@sourceforge.net noreply@sourceforge.net
Fri, 03 May 2002 01:28:04 -0700


Patches item #550551, was opened at 2002-04-30 09:18
You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=550551&group_id=5470

Category: Core (C code)
Group: None
Status: Open
>Resolution: Postponed
Priority: 5
Submitted By: Scott Gilbert (xscott)
Assigned to: Nobody/Anonymous (nobody)
Summary: Read/Write buffers from buffer()

Initial Comment:
The buffer() builtin does not currently allow the 
creation of read-write buffers.  So there is no way 
from pure Python code to manipulate objects which 
support getting a writable pointer via their 
PyBufferProcs.  This patch tries to create a read-
write buffer first, and if that fails it will return a 
read-only buffer object as before.

It's tempting to check if the PyBufferProcs has the 
bf_getwritebuffer pointer and simply return 
PyBuffer_FromReadWriteObject(...) in this case.  This 
ends up being incorrect for PyStrings since they do 
have the bf_getwritebuffer pointer, but that always 
sets an exception.


----------------------------------------------------------------------

>Comment By: Scott Gilbert (xscott)
Date: 2002-05-03 08:28

Message:
Logged In: YES 
user_id=38318

This patch should not be accepted until another one fixing 
a bug in PyBufferObjects is accepter.  So please back 
burner this one until further notice.



----------------------------------------------------------------------

You can respond by visiting: 
http://sourceforge.net/tracker/?func=detail&atid=305470&aid=550551&group_id=5470