Message163309
Thanks. It looks like that <<= report has uncovered a bug in the way that ctypes lays out bitfields: in the following, BITS.M should (I believe) look like: <Field type=c_short, ofs=4:0, bits=1>. Instead, ctypes is trying to store a bitfield starting at bit position 17 of a short, which doesn't make much sense.
iwasawa:cpython mdickinson$ ./python.exe
Python 3.3.0a4+ (default:2035c5ad4239+, Jun 21 2012, 08:30:36)
[GCC 4.2.1 (Apple Inc. build 5664)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> from ctypes import Structure, c_int, c_short
>>> class BITS(Structure):
... _fields_ = [("A", c_int, 17), ("M", c_short, 1)]
...
>>> BITS.M
<Field type=c_short, ofs=2:17, bits=1> |
|
Date |
User |
Action |
Args |
2012-06-21 08:01:07 | mark.dickinson | set | recipients:
+ mark.dickinson, jcea, eric.smith, cvrebert, skrah, regehr, python-dev |
2012-06-21 08:01:07 | mark.dickinson | set | messageid: <1340265667.65.0.908510826833.issue9530@psf.upfronthosting.co.za> |
2012-06-21 08:01:07 | mark.dickinson | link | issue9530 messages |
2012-06-21 08:01:06 | mark.dickinson | create | |
|