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

2019-07-30 Thread Tommy Sparber
Tommy Sparber added the comment: This bug is still present using Python 3.7. I'm also not sure how to fix the leakage of the internal bitfield size encoding. -- nosy: +tsparber versions: +Python 3.5, Python 3.6, Python 3.7 ___ 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):

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

2012-07-26 Thread Thomas Heller
New submission from Thomas Heller thel...@ctypes.org: 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

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

2012-07-26 Thread Thomas Heller
Thomas Heller thel...@ctypes.org 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 rep...@bugs.python.org

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

2012-07-26 Thread Arfrever Frehtes Taifersar Arahesis
Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com: -- nosy: +Arfrever ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15459 ___

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

2012-07-26 Thread Éric Araujo
Changes by Éric Araujo mer...@netwok.org: -- nosy: +amaury.forgeotdarc, belopolsky, meador.inge stage: - patch review versions: +Python 3.2 -Python 3.4 ___ Python tracker rep...@bugs.python.org http://bugs.python.org/issue15459