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 ned.deily
Recipients ned.deily, stutzbach, theller
Date 2010-09-29.22:00:13
SpamBayes Score 3.281877e-05
Marked as misclassified No
Message-id <1285797615.37.0.569535220092.issue9989@psf.upfronthosting.co.za>
In-reply-to
Content
An endian issue? (i.e. on OS X, it works on ppc but not Intel)
A slightly more detailed test case:

$ more test_ctypes.py
import ctypes
class Blah2(ctypes.Structure):
    _fields_ = [("x", ctypes.c_uint64, 64),
                ("y", ctypes.c_uint64)]
val = 0x0123456789ABCDEF
x = Blah2(val, val)
print(Blah2.x)
print(hex(x.x))
print(Blah2.y)
print(hex(x.y))
$ arch -i386 python2.7 test_ctypes.py
<Field type=c_ulonglong, ofs=0:0, bits=64>
0x0L
<Field type=c_ulonglong, ofs=8, size=8>
0x123456789abcdefL
$ arch -x86_64 python2.7 test_ctypes.py
<Field type=c_ulong, ofs=0:0, bits=64>
0x0L
<Field type=c_ulong, ofs=8, size=8>
0x123456789abcdefL
$ arch -ppc python2.7 test_ctypes.py
<Field type=c_ulonglong, ofs=0:0, bits=64>
0x123456789abcdefL
<Field type=c_ulonglong, ofs=8, size=8>
0x123456789abcdefL
History
Date User Action Args
2010-09-29 22:00:15ned.deilysetrecipients: + ned.deily, theller, stutzbach
2010-09-29 22:00:15ned.deilysetmessageid: <1285797615.37.0.569535220092.issue9989@psf.upfronthosting.co.za>
2010-09-29 22:00:13ned.deilylinkissue9989 messages
2010-09-29 22:00:13ned.deilycreate