[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-22 Thread Vinay Sajip
Change by Vinay Sajip : -- resolution: -> fixed stage: -> resolved status: open -> closed ___ Python tracker ___ ___

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-14 Thread Matthew Newville
Matthew Newville added the comment: @eryksun Sorry for the imprecision -- I was mixing what we do on Linux and Windows. A minimum verifiable example for Linux/MacOS would be import ctypes class bitstruct(ctypes.Structure): _fields_ = [('addr', ctypes.c_long),

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-14 Thread Eryk Sun
Eryk Sun added the comment: > With Python 3.7.6 this raises an exception at the ctypes.CFUNCTYPE() > call with > ... > TypeError: item 1 in _argtypes_ passes a struct/union with a bitfield > by value, which is unsupported. I cannot reproduce the problem as stated in 3.7.6 in Windows. The

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-14 Thread Vinay Sajip
Vinay Sajip added the comment: The change has now been reverted, including on 3.8 and 3.7, so I think that this issue can be closed. Any naysayers? -- ___ Python tracker ___

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-13 Thread Ned Deily
Change by Ned Deily : -- keywords: +3.7regression, 3.8regression versions: +Python 3.8 ___ Python tracker ___ ___ Python-bugs-list

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-13 Thread Matthew Newville
Matthew Newville added the comment: So, again, I'm trying to understand what the best workaround for this change is. I asked "can this workaround be improved" twice and got no reply, while getting plenty of responses to questions about the development process. I take this to mean that the

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-12 Thread Vinay Sajip
Vinay Sajip added the comment: > it appears that an old, poorly verified bug report Why do you say the bug report is poorly verified? The libffi maintainers accept it is an issue. https://github.com/libffi/libffi/issues/33 > inspired a change that was actually not well tested and so

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-12 Thread Matthew Newville
Matthew Newville added the comment: Thanks for the reply and the fix -- I have not tried the master branch, but will try to do that soon. If I understand correctly, we will have to stick with our kludgy "workaround" version in order to work with Python 3.7.6 and 3.8.1. Or is there a better

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-12 Thread Vinay Sajip
Vinay Sajip added the comment: The change which caused this breakage has been reverted, at least for now. bpo-16576 is related to bpo-16575 (which is about unions rather than bitfields, but the cases have things in common). Refer to bpo-16575 for PRs relating to the reversion. This includes

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-12 Thread Cheryl Sabella
Cheryl Sabella added the comment: Adding @vinay.sajip to the nosy list as he worked on issue16576. -- nosy: +cheryl.sabella, vinay.sajip ___ Python tracker ___

[issue39295] usage of bitfields in ctypes structures changed between 3.7.5 and 3.7.6

2020-01-10 Thread Matthew Newville
New submission from Matthew Newville : We have a library (https://github.com/pyepics/pyepics) that wraps several C structures for a communication protocol library that involves many C->Python callbacks. One of the simpler structures we wrap with ctypes is defined with typedef struct