Movatterモバイル変換


[0]ホーム

URL:


homepage

Issue5506

This issue trackerhas been migrated toGitHub, and is currentlyread-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title:io.BytesIO doesn't support the buffer protocol
Type:enhancementStage:resolved
Components:IO, Library (Lib)Versions:Python 3.2
process
Status:closedResolution:fixed
Dependencies:Superseder:
Assigned To:Nosy List: amaury.forgeotdarc, benjamin.peterson, georg.brandl, pitrou
Priority:normalKeywords:patch

Created on2009-03-18 10:40 bypitrou, last changed2022-04-11 14:56 byadmin. This issue is nowclosed.

Files
File nameUploadedDescriptionEdit
bytesiobuf2.patchpitrou,2010-09-03 17:53
Messages (7)
msg83740 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2009-03-18 10:40
It may be logical for BytesIO to support the buffer protocol (readable/and/ writable).
msg85504 -(view)Author: Georg Brandl (georg.brandl)*(Python committer)Date: 2009-04-05 14:41
Is this still unimplemented?
msg85507 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2009-04-05 14:52
Yes.I don't remember which use case I was thinking about when I suggestedthis, but it may be useful to e.g. write() all the data to a file objectwithout actually making a copy (getvalue() does).
msg115304 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2010-09-01 14:48
Thinking about it, I'm not sure this would be a good idea to do this by default. There is an ambiguity where it's not obvious if the buffer would contain the whole data or only the bytes after the current position.I think perhaps an explicit method (getbuffer()?) could be used to export a buffer-compatible object, without copying. Perhaps a memoryview; this would imply defining bf_releasebuffer without bf_getbuffer.
msg115476 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2010-09-03 17:49
Here is a patch implementing getbuffer(), together with tests.
msg115479 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2010-09-03 17:53
There was an unused "weakreflist" member.
msg115728 -(view)Author: Antoine Pitrou (pitrou)*(Python committer)Date: 2010-09-06 18:50
This was committed inr84562.
History
DateUserActionArgs
2022-04-11 14:56:46adminsetgithub: 49756
2010-09-06 18:50:12pitrousetstatus: open -> closed
resolution: fixed
messages: +msg115728

stage: patch review -> resolved
2010-09-03 17:53:48pitrousetnosy: +amaury.forgeotdarc,benjamin.peterson
components: + IO
2010-09-03 17:53:33pitrousetfiles: -bytesiobuf2.patch
2010-09-03 17:53:24pitrousetfiles: +bytesiobuf2.patch

messages: +msg115479
2010-09-03 17:49:12pitrousetfiles: +bytesiobuf2.patch
keywords: +patch
messages: +msg115476

stage: needs patch -> patch review
2010-09-01 14:48:06pitrousetmessages: +msg115304
stage: test needed -> needs patch
2010-08-09 03:55:35terry.reedysetversions: + Python 3.2, - Python 3.1
2009-04-05 14:52:09pitrousetmessages: +msg85507
2009-04-05 14:41:01georg.brandlsetnosy: +georg.brandl
messages: +msg85504
2009-03-18 10:40:11pitroucreate
Supported byThe Python Software Foundation,
Powered byRoundup
Copyright © 1990-2022,Python Software Foundation
Legal Statements

[8]ページ先頭

©2009-2026 Movatter.jp