[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2021-02-28 Thread miss-islington
miss-islington added the comment: New changeset 0d7ad9fb38c041c46094087b0cf2c8ce44916b11 by Filipe Laíns in branch 'master': bpo-29753: fix merging packed bitfields in ctypes struct/union (GH-19850) https://github.com/python/cpython/commit/0d7ad9fb38c041c46094087b0cf2c8ce44916b11 --

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-06-29 Thread Antoine Pitrou
Change by Antoine Pitrou : -- versions: +Python 3.8, Python 3.9 -Python 2.7, Python 3.4, Python 3.5, Python 3.6 ___ Python tracker ___

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-05-02 Thread Filipe Laíns
Filipe Laíns added the comment: My patches should resolve this fully. Please test it to make sure I did not miss any corner case. https://github.com/python/cpython/pull/19850 -- ___ Python tracker

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-05-01 Thread Filipe Laíns
Change by Filipe Laíns : -- keywords: +patch pull_requests: +19167 stage: -> patch review pull_request: https://github.com/python/cpython/pull/19850 ___ Python tracker ___

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-05-01 Thread Filipe Laíns
Change by Filipe Laíns : -- nosy: +FFY00 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2020-03-05 Thread Sam Price
Sam Price added the comment: I ran into this bug on mac and submitted a duplicate issue of 39858 If you add the check *pfield_size != *pbitofs it fixes this bug. #ifndef MS_WIN32 } else if (bitsize /* this is a bitfield request */ && *pfield_size /* we have a bitfield open */

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2019-07-14 Thread hai shi
Change by hai shi : -- nosy: +shihai1991 ___ Python tracker ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2019-05-30 Thread Karl Ding
Karl Ding added the comment: I believe the example can be simplified to the following: class MyStructure(ctypes.Structure): _pack_ = 1 _fields_ = [('A', ctypes.c_uint32, 8)] assert ctypes.sizeof(MyStructure) == 1 Here, ctypes.sizeof returns 4 on my

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2018-04-01 Thread Marc Le Roy
Marc Le Roy added the comment: No solution found to solve this issue ? The anomaly is not a cross platform inconsistency, it is an inconsistency between the behaviours of GCC and ctypes, both under Linux or Cygwin, when defining packed structures : [Marc@I7-860

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-11-17 Thread Charles Machalow
Charles Machalow added the comment: All of Python is implicitly cross platform. If something isn't actually cross platform, it should be mentioned explicitly in the documentation. For example see the mmap documentation, it explicitly say on Unix it does X, on Windows it

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-11-17 Thread Antti Haapala
Antti Haapala added the comment: "Antti, is there a place in the ctypes documentation that explicitly says ctypes is not meant to be used cross-platform? If not, shouldn't that be mentioned?" I don't know about that, but the thing is nowhere does it say that it is meant

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-11-16 Thread Charles Machalow
Charles Machalow added the comment: Antti, is there a place in the ctypes documentation that explicitly says ctypes is not meant to be used cross-platform? If not, shouldn't that be mentioned? I think ultimately ctypes should default to standard OS/compiler behavior, but

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-11-16 Thread Marc Le Roy
Change by Marc Le Roy : -- nosy: +mleroy003 ___ Python tracker ___ ___ Python-bugs-list

[issue29753] Ctypes Packing Bitfields Incorrectly - Linux

2017-08-30 Thread Antti Haapala
Antti Haapala added the comment: To Charles first: "Gives back a sizeof of 8 on Windows and 10 on Linux. The inconsistency makes it difficult to have code work cross-platform." The bitfields in particular and ctypes in general have *never* been meant to be cross-platform - instead they just