[New-bugs-announce] [issue30510] c_bool type not supported for BigEndianStructure on little-endian machine

Hassan El Karouni report at bugs.python.org
Tue May 30 06:35:54 EDT 2017


New submission from Hassan El Karouni:

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:

c_bool.__ctype_le__ = c_bool.__ctype_be__ = c_bool
_check_size(c_bool)

----------
components: ctypes
messages: 294747
nosy: Hassan El Karouni
priority: normal
severity: normal
status: open
title: c_bool type not supported for BigEndianStructure on little-endian machine
type: compile error
versions: Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30510>
_______________________________________


More information about the New-bugs-announce mailing list