higstar added the comment:
Issue was originally found on do sp2 on Python 2.6.
Thanks Vlad, this rendered ctypes useless for my purposes, had to mask and
shift myself.
On Jun 25, 2011 8:32 AM, "Vlad Riscutia" wrote:
>
> Vlad Riscutia added the comment:
>
> Attached is
higstar added the comment:
Also run in 3.0
--
versions: +Python 3.0
___
Python tracker
<http://bugs.python.org/issue6493>
___
___
Python-bugs-list mailin
New submission from higstar :
Added a test to test_bitfields.py:
def test_uint32(self):
class X(Structure):
_fields_ = [("a", c_uint32, 32)]
x = X()
x.a = 10
self.failUnlessEqual(x.a, 10)
Run in Python 2.5.2
higstar added the comment:
Another example of this:
---
import ctypes
correct_data_dict = {
'Data0' : 0x,
'Data1' : 0x02,
'Data2' : 0x0AAA,
}
class closest_fit(ctypes.B
higstar added the comment:
I added the following to test_bitfields.py and got the results listed below:
def test_ulonglong_crossing_32_boundary(self):
class X(BigEndianStructure):
_fields_ = [("a", c_ulonglong, 16),
("b", c_ulonglong, 32),
Changes by higstar :
--
title: c_ulonglong structure members appear read-only -> support read/write
c_ulonglong type bitfield structures
___
Python tracker
<http://bugs.python.org/iss
higstar added the comment:
After reading the documentation for ctypes (specifically "Bit fields are
only possible for integer fields" from section 16.15.1.12) I've updated
the test.
---
import ctypes
import time
class uint(ctypes.BigEndianStructure):
_pack_ = 1# al
higstar added the comment:
Right...I've just found a caveat in section 16.15.1.12 of the html
documentation which means this should be a feature request:
"Bit fields are only possible for integer fields"
--
type: -> feature request
Changes by higstar :
--
type: compile error ->
___
Python tracker
<http://bugs.python.org/issue6068>
___
___
Python-bugs-list mailing list
Unsubscri
New submission from higstar :
Structure fails to correctly cast from a 2 byte bitfield.
>From my very limited investigation, is looks like when using a member
type of less than the total size of the structure (or at least the size
of any byte boundaries) the casting is not done correctly?
New submission from higstar :
When defining a structure with members of ctype type c_ulonglong, some
members appear read only?
I created this test.py and appended the results below:
-
import ctypes
import time
class all_ulong(ctypes.BigEndianStructure):
_fields_
11 matches
Mail list logo