[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Thomas Heller
New submission from Thomas Heller : When a ctypes Structure uses a subclass of c_int, c_short, c_byte in the _fields_ list to define bitfields, the results are wrong. The attached script showbug.py demonstrates this behaviour. -- components: ctypes files: showbug.py keywords: needs rev

[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Thomas Heller
Thomas Heller added the comment: The attached patch for branch default fixes this issue. It also contains a unittest. -- Added file: http://bugs.python.org/file26530/bitfields.patch ___ Python tracker __

[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis : -- nosy: +Arfrever ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscri

[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-07-26 Thread Éric Araujo
Changes by Éric Araujo : -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge stage: -> patch review versions: +Python 3.2 -Python 3.4 ___ Python tracker ___ __

[issue15459] ctypes Structures with subclassed types in the _fields_ list

2012-08-02 Thread Meador Inge
Meador Inge added the comment: OK, I finally had some time to look at this. The attached patch does fix the issue. However, it has a nasty side effect in that the encoded bitfield size stays with the field member object: >>> class SubByte(c_ubyte): pass ... >>> class A(Structure):