[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde
Roman Zeyde added the comment: You are correct - the documentation is right: "Format characters have the following meaning; the conversion between C and Python values should be obvious given their types. The ‘Standard size’ column refers to the size of the packed value in bytes when using stan

[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde
Changes by Roman Zeyde : -- resolution: -> works for me status: open -> closed ___ Python tracker ___ ___ Python-bugs-list mailing li

[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Stefan Krah
Stefan Krah added the comment: The docs say: "Native size and alignment are determined using the C compiler’s sizeof expression. This is always combined with native byte order." sizeof(long) is 8 on your platform, so I don't see anything wrong here. Or is another part of the documentation unc

[issue18169] struct.pack() behaves strangely for 'L' on 64bit Linux

2013-06-08 Thread Roman Zeyde
New submission from Roman Zeyde: Reproduction: Python 2.7.4 (default, Apr 19 2013, 18:28:01) [GCC 4.7.3] on linux2 Type "help", "copyright", "credits" or "license" for more information. >>> import struct >>> struct.pack('!L', 0x01020304) '\x01\x02\x03\x04' >>> struct.pack('>L', 0x01020304) '\x0