Mark Dickinson added the comment:

This is working as designed: the result of struct.calcsize matches the length 
of the string that you'll get back from struct.pack using that format.  Padding 
isn't included after the last entry in the struct.

That's not to say that it was a good design decision, but that's the design 
that was chosen, and it's not realistic to change this for the bugfix releases. 
 It may be possible to do something for Python 3.4.

You can add a '0L' to the end of your struct to force padding bytes at the end. 
 See:

http://docs.python.org/2/library/struct.html#examples

for an example of this.

See also #7189, #5145.

----------
nosy: +mark.dickinson
versions: +Python 3.4 -Python 2.6

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue17617>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to