[issue32470] Unexpected behavior of struct.pack

2017-12-31 Thread Benjamin Peterson
Benjamin Peterson added the comment: That's because of alignment. See https://docs.python.org/3/library/struct.html#struct-alignment -- nosy: +benjamin.peterson resolution: -> not a bug stage: -> resolved status: open -> closed ___ Python tracker

[issue32470] Unexpected behavior of struct.pack

2017-12-31 Thread Luka Malisa
New submission from Luka Malisa : >>> import struct >>> struct.pack("IB", 1, 1) b'\x01\x00\x00\x00\x01' >>> struct.pack("BI", 1, 1) b'\x01\x00\x00\x00\x01\x00\x00\x00' -- ___ Python tracker ___

[issue32470] Unexpected behavior of struct.pack

2017-12-31 Thread Luka Malisa
Change by Luka Malisa : -- components: Library (Lib) nosy: Luka Malisa priority: normal severity: normal status: open title: Unexpected behavior of struct.pack type: behavior versions: Python 2.7, Python 3.5 ___ Python tracker