[issue6924] struct.unpack weird behavior with bi (byte then integer)

2009-09-16 Thread Emmanuel Bengio
New submission from Emmanuel Bengio beng...@gmail.com: Using the following command in Python 2.6.1: struct.unpack(BI,12345) Traceback (most recent call last): File pyshell#1, line 1, in module struct.unpack(BI,12345) error: unpack requires a string argument of length 8 I get this error

[issue6924] struct.unpack weird behavior with bi (byte then integer)

2009-09-16 Thread Mark Dickinson
Mark Dickinson dicki...@gmail.com added the comment: I think this is expected behaviour: the key point is that structs can include padding bytes. From the documentation: By default, C numbers are represented in the machine’s native format and byte order, and properly aligned by skipping pad