[New-bugs-announce] [issue8019] struct.unpack() expects wrong number of bytes

Nick report at bugs.python.org
Thu Feb 25 19:22:30 CET 2010


New submission from Nick <niki at codingrobot.com>:

the code I'm trying to execute (block is long enough):
unpack("2IB2I", block)

executing this raises an exception:
struct.error: unpack requires a bytes argument of length 20

Setting native byte-order with '@' causes the same error.
Specifying the correct byte-order either with '>' or '<', or
native with '=' helps and unpack expects the correct number (17) of bytes.

----------
components: Library (Lib)
messages: 100096
nosy: codingrobot
severity: normal
status: open
title: struct.unpack() expects wrong number of bytes
type: behavior
versions: Python 2.6, Python 3.1

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8019>
_______________________________________


More information about the New-bugs-announce mailing list