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 hannes.reuter
Recipients hannes.reuter, theller
Date 2010-07-13.15:00:05
SpamBayes Score 0.0018767462
Marked as misclassified No
Message-id <1279033209.41.0.410142321642.issue9249@psf.upfronthosting.co.za>
In-reply-to
Content
on http://docs.python.org/library/struct.html
in section 7.3.2.2. Format Characters in the table one can find that 
L -> unsigned long -> 	integer-> should have a 4 byte dataspace.
(same applies for l), which seems to be correct -> 32bit/8=4


On a Ubuntu 64 , Python 2.6,  
a) calcsize reports it uses 8 byte
b) by writing data to a file and reading it back in I could confirm that it uses as well 8 bytes of binary data -> ofile2.write(struct.pack('LL',int(x[0]), int(x[1])))

Q: Is that behavior what we see a Docu error ?
Q: Is that behavior what we see general struct problem ? 
add1: in # 2263 e.g. we see problems for L type data in relation to np ?  
add2: IMHO certainly not a padding problem like in #7355


for reproduction:

from struct import *
calcsize('H')
2 -> correct to docu
calcsize('f')
4 -> correct to docu
calcsize('L')
8   -> should be 4
calcsize('l')
8 -> should be 4
calcsize('x')
1 -> correct to docu

So either docu is wrong, or struct has an error.
History
Date User Action Args
2010-07-13 15:00:09hannes.reutersetrecipients: + hannes.reuter, theller
2010-07-13 15:00:09hannes.reutersetmessageid: <1279033209.41.0.410142321642.issue9249@psf.upfronthosting.co.za>
2010-07-13 15:00:06hannes.reuterlinkissue9249 messages
2010-07-13 15:00:05hannes.reutercreate