This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author mark.dickinson
Recipients eric.smith, mark.dickinson, sgk284
Date 2009-11-19.14:33:01
SpamBayes Score 5.4475327e-06
Marked as misclassified No
Message-id <1258641184.35.0.597842496306.issue7355@psf.upfronthosting.co.za>
In-reply-to
Content
What Eric said.  You can see the padding explicitly in the results of
struct.pack:

>>> struct.pack("ci", '*', 0x12131415) # 8-byte result, 3 padding bytes
'*\x00\x00\x00\x15\x14\x13\x12'
>>> struct.pack("ic", 0x12131415, '*') # 5-byte result, no padding.
'\x15\x14\x13\x12*'

Note the 3 zero bytes in the first result string.

This gets reported frequently enough that I wonder whether the docs
should be rearranged and/or expanded.  The existence of padding is
mentioned, but not particularly prominently or thoroughly.
History
Date User Action Args
2009-11-19 14:33:04mark.dickinsonsetrecipients: + mark.dickinson, eric.smith, sgk284
2009-11-19 14:33:04mark.dickinsonsetmessageid: <1258641184.35.0.597842496306.issue7355@psf.upfronthosting.co.za>
2009-11-19 14:33:02mark.dickinsonlinkissue7355 messages
2009-11-19 14:33:01mark.dickinsoncreate