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

noreply@sourceforge.net noreply@sourceforge.net
Tue, 23 Jul 2002 01:08:54 -0700


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

Category: Core (C code)
Group: None
>Status: Deleted
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-07-23 08:08

Message:
Logged In: YES 
user_id=38318

The buffer builtin appears to be scheduled for deprecation, so 
this small patch is not worthwhile.

This is independant of creating buffer objects from the C API 
(as the that does not appear to be deprecated).



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

Comment By: Guido van Rossum (gvanrossum)
Date: 2002-05-07 12:35

Message:
Logged In: YES 
user_id=6380

Please don't assign patches to random developers.

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

Comment By: Scott Gilbert (xscott)
Date: 2002-05-05 04:29

Message:
Logged In: YES 
user_id=38318

If you take patch 552438, then there shouldn't be anything 
wrong with this small feature patch...



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

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: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=550551&group_id=5470