You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
assignee=Noneclosed_at=Nonecreated_at=<Date2017-05-30.10:35:54.469>labels= ['ctypes', 'build', '3.11']
title='c_bool type not supported for BigEndianStructure on little-endian machine'updated_at=<Date2022-01-23.18:29:53.273>user='https://bugs.python.org/HassanElKarouni'
When trying to create a BigEndianStructure containing a c_bool field (on a windows machine), i get the following traceback:
File "/home/elkarouh/anaconda2/lib/python2.7/ctypes/_endian.py", line 24, in _other_endian
raise TypeError("This type does not support other endian: %s" % typ)
TypeError: This type does not support other endian: <class 'ctypes.c_bool'>
I fixed the problem by patching __init__.py under the ctypes directory by adding the following two lines:
>>> from ctypes import*
>>> classr( BigEndianStructure ):
... _fields_ = [( "d0", c_uint32),
... ( "d1", c_bool )
... ]
...
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/Users/iritkatriel/src/cpython-654/Lib/ctypes/_endian.py", line 31, in __setattr__
fields.append((name, _other_endian(typ)) + rest)
^^^^^^^^^^^^^^^^^^
File "/Users/iritkatriel/src/cpython-654/Lib/ctypes/_endian.py", line 21, in _other_endian
raise TypeError("This type does not support other endian: %s" % typ)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
TypeError: This type does not support other endian: <class 'ctypes.c_bool'>
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: