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.

Author belopolsky
Recipients belopolsky, skrah
Date 2012-09-03.16:24:57
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1346689497.87.0.0543181973017.issue15857@psf.upfronthosting.co.za>
In-reply-to
Content
Starting with the example in memoryview documentation:

>>> from ctypes import BigEndianStructure, c_long
>>> class BEPoint(BigEndianStructure):
...     _fields_ = [("x", c_long), ("y", c_long)]
...
>>> point = BEPoint(100, 200)
>>> a = memoryview(point)

I am trying to unpack the resulting view:

>>> a.tolist()
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
NotImplementedError: memoryview: unsupported format T{>l:x:>l:y:}

>>> struct.unpack_from(a.format,a)
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
struct.error: bad char in struct format

>>> struct.unpack_from('>ll',a)
(0, 100)


It looks like there is one or more bugs in play here.
History
Date User Action Args
2012-09-03 16:24:57belopolskysetrecipients: + belopolsky, skrah
2012-09-03 16:24:57belopolskysetmessageid: <1346689497.87.0.0543181973017.issue15857@psf.upfronthosting.co.za>
2012-09-03 16:24:57belopolskylinkissue15857 messages
2012-09-03 16:24:57belopolskycreate