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.
Created on 2010年10月27日 08:49 by kristjan.jonsson, last changed 2022年04月11日 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| buffer_newbuf.patch | kristjan.jonsson, 2010年10月27日 08:49 | review | ||
| Messages (9) | |||
|---|---|---|---|
| msg119683 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) | Date: 2010年10月27日 08:49 | |
The BufferObject in 2.7 doesn't support the new buffer interface. This makes it useless for use with the new memoryview object. This simple patch adds that support. |
|||
| msg119691 - (view) | Author: Éric Araujo (eric.araujo) * (Python committer) | Date: 2010年10月27日 11:25 | |
Unless there is a mismatch between the documentation and the code, I suspect this will be rejected by the release manager. |
|||
| msg119714 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) | Date: 2010年10月27日 14:40 | |
Well, we can always fix the documentation, then :) Seriously, having two different buffer interfaces in the interpreter core that can only communicate through weird middle men (like str()) should be considered a bug. There shouldn't be any surprises like this. Simple is better than complex. |
|||
| msg119721 - (view) | Author: Marc-Andre Lemburg (lemburg) * (Python committer) | Date: 2010年10月27日 17:08 | |
The memoryview object was added to simplify porting applications to Python3. If that backport is incomplete in the sense that the memoryview object is not compatible with the standard Python2 object for such memory views, then I'd consider that a bug. Without compatibility to the buffer objects, there's no way to make other Python2 buffer interface compatible object compatible to memoryviews. Alternatively, the Python2 memoryview object implementation could also accept objects with the old buffer interface, much like "s*" does. Note that the patch needs to check the buffer flags - writing to such buffers is not allowed. |
|||
| msg119749 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) | Date: 2010年10月28日 01:28 | |
Do you mean that we should disable writing for the new style buffer interface? Currently the patch respects the Buffer object's read-only flag (self->b_readonly):
static int buffer_getbuffer(PyBufferObject *self, Py_buffer *buf, int flags)
{
void *ptr;
Py_ssize_t size;
if (!get_buf(self, &ptr, &size, ANY_BUFFER))
return -1;
return PyBuffer_FillInfo(buf, (PyObject*)self, ptr, size,
self->b_readonly, flags);
}
|
|||
| msg156388 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) | Date: 2012年03月20日 09:12 | |
Bumping this. Do we want this fixed as a bug in 2.7 or left alone? |
|||
| msg184527 - (view) | Author: Kristján Valur Jónsson (kristjan.jonsson) * (Python committer) | Date: 2013年03月18日 21:20 | |
Bump, 2.7.4 will be cut next week ... |
|||
| msg184561 - (view) | Author: Tres Seaver (tseaver) * | Date: 2013年03月19日 00:05 | |
Looks good to me. |
|||
| msg184716 - (view) | Author: Roundup Robot (python-dev) (Python triager) | Date: 2013年03月20日 00:40 | |
New changeset 6b3217b96a77 by Kristján Valur Jónsson in branch '2.7': Issue #10211 : Buffer object should support the new buffer interface. http://hg.python.org/cpython/rev/6b3217b96a77 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022年04月11日 14:57:07 | admin | set | github: 54420 |
| 2013年03月22日 22:53:21 | Arfrever | set | stage: resolved |
| 2013年03月22日 17:26:10 | kristjan.jonsson | set | status: open -> closed resolution: fixed |
| 2013年03月20日 00:40:30 | python-dev | set | nosy:
+ python-dev messages: + msg184716 |
| 2013年03月19日 00:12:10 | Arfrever | set | nosy:
+ Arfrever |
| 2013年03月19日 00:05:34 | tseaver | set | nosy:
+ tseaver messages: + msg184561 |
| 2013年03月18日 21:20:34 | kristjan.jonsson | set | messages: + msg184527 |
| 2012年03月20日 09:12:02 | kristjan.jonsson | set | messages: + msg156388 |
| 2012年02月09日 22:45:55 | skrah | set | nosy:
+ skrah |
| 2010年10月28日 13:53:12 | eric.araujo | set | nosy:
+ pitrou |
| 2010年10月28日 01:28:42 | kristjan.jonsson | set | messages: + msg119749 |
| 2010年10月27日 17:08:29 | lemburg | set | nosy:
+ lemburg messages: + msg119721 |
| 2010年10月27日 14:40:01 | kristjan.jonsson | set | messages: + msg119714 |
| 2010年10月27日 11:25:10 | eric.araujo | set | nosy:
+ eric.araujo, benjamin.peterson messages: + msg119691 |
| 2010年10月27日 08:49:10 | kristjan.jonsson | create | |