Amaury Forgeot d'Arc added the comment:
You can also use _pack_ = 1 to override the default alignment rules:
http://docs.python.org/3/library/ctypes.html#ctypes.Structure._pack_
--
nosy: +amaury.forgeotdarc
___
Python tracker rep...@bugs.python.org
New submission from Tomer Levi:
Whenever you create a ctypes.Structure with mixed ctypes, the size of all
components is calculated by the size of largest one. This is especially
irritating when trying to use Structure on bytearray.
The problem repeated for me in Python2.6 and 2.7 (both 32bit
Alex Gaynor added the comment:
This is how padding works in the C ABI, not a bug.
--
nosy: +alex
resolution: - invalid
status: open - closed
___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue18225