[ python-Bugs-1563759 ] struct.unpack doens't support buffer protocol objects

SourceForge.net noreply at sourceforge.net
Sat Sep 23 00:17:45 CEST 2006


Bugs item #1563759, was opened at 2006-09-23 01:17
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1563759&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Adal Chiriliuc (adalx)
Assigned to: Nobody/Anonymous (nobody)
Summary: struct.unpack doens't support buffer protocol objects

Initial Comment:
If you pass an object which supports the buffer
protocol to struct.unpack it will fail because it
specifically checks for a string.

You should use PyObject_AsReadBuffer instead.

If this code is performance critical, you could add an
unpack_buffer method or something like that.

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

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1563759&group_id=5470


More information about the Python-bugs-list mailing list