-
-
Notifications
You must be signed in to change notification settings - Fork 32.3k
gh-97588: Fix ctypes structs #97702
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Merged
Merged
gh-97588: Fix ctypes structs #97702
Changes from 1 commit
Commits
Show all changes
128 commits
Select commit
Hold shift + click to select a range
7922585
gh-97588: Fix ctypes structs
matthiasgoergens 2307932
📜🤖 Added by blurb_it.
blurb-it[bot] 47f826c
Handling pack as well
matthiasgoergens 5a32211
Handle basedict, too
matthiasgoergens 8d79d8f
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 2d07375
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 8bc8535
Merge remote-tracking branch 'matthias/fix-bitfield-clean' into fix-b…
matthiasgoergens c3d162b
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens e5ed9ac
Split windows and linux
matthiasgoergens b0f9819
Compiles
matthiasgoergens 2dee0e3
Abstract out proto stuff
matthiasgoergens 79ef347
Clean align
matthiasgoergens 6170dad
Hypothesis tests pass
matthiasgoergens 871ca1a
Formatting
matthiasgoergens c162144
Clean up
matthiasgoergens a57cf2c
Adapt tests for Windows
matthiasgoergens 3f7c4cc
Fix order
matthiasgoergens e39a271
Fix alignment test
matthiasgoergens 359ed58
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens 52ef8d2
Avoid casting
matthiasgoergens e8102c4
Fixup
matthiasgoergens 600e144
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 9bad706
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 5121857
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens 6cd27ea
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens 6b6fa8a
Add ability to force msvc compatibility even when not doing any packing
matthiasgoergens ca9d580
More tests
matthiasgoergens 1401ee4
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 235fa68
Big endian works
matthiasgoergens a534e18
Merge remote-tracking branch 'matthias/fix-bitfield-clean' into fix-b…
matthiasgoergens 53db061
More tests
matthiasgoergens 9c249c3
More asserts
matthiasgoergens 3cf4747
Drop unneeded parameters
matthiasgoergens 8beddb9
Drop unneeded parameters
matthiasgoergens 9b64ff6
Drop unneeded parameters
matthiasgoergens 4d0dab5
Clean up
matthiasgoergens bf98667
Explain
matthiasgoergens 8223063
More cleanup
matthiasgoergens e80a09a
More cleanup
matthiasgoergens 33a10fb
More cleanup
matthiasgoergens 0f3c5a3
Move common assert
matthiasgoergens 47eca3c
Break line
matthiasgoergens 456afd0
Clean TODO
matthiasgoergens bc799ac
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 212cf13
Fix test for Windows
matthiasgoergens e7e5ae9
Merge remote-tracking branch 'matthias/fix-bitfield-clean' into fix-b…
matthiasgoergens 45e26ec
Remove warning
matthiasgoergens ab42187
Port test from PR-19850
matthiasgoergens 640c062
Fix assert
matthiasgoergens f3e04af
Revert "Port test from PR-19850"
matthiasgoergens bff34a1
Support gcc's packed structs
matthiasgoergens 5d6f0f7
Remove gcc_packed experiment
matthiasgoergens d9c1fca
Fix test
matthiasgoergens cc9ea8a
Fix ms_struct
matthiasgoergens 1554083
Fix ms_struct
matthiasgoergens a86eadc
Indenting
matthiasgoergens eefa1ad
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens 28c7fe7
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens f0a92b0
Fix miscounted parens
matthiasgoergens a3a390b
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens e997b5f
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens 5a7ea09
make regen-all
matthiasgoergens 0f73919
clean up
8000
matthiasgoergens cdfc3c6
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 6226e55
make regen-all
matthiasgoergens 4d48eba
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 20b5582
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens eb502d7
Explain where 999 comes from
matthiasgoergens 0cf5f4e
fix typo
matthiasgoergens 3457558
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens fd3cd0b
Explain magic 999
matthiasgoergens 2d8492e
Incorporate Sam's tests
matthiasgoergens a9f7f14
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens bee6c53
Tickle CI/CD
matthiasgoergens 220e19e
Merge branch 'main' into fix-bitfield-clean
matthiasgoergens 60cebe2
Merge branch 'main' into fix-bitfield-clean
gpshead 3424a7d
Merge commit '698a0da7d440856a90b45964e9082b5a55387b80' into fix-bitf…
matthiasgoergens 2506eea
Merge commit '0841ca7932987f30a2a23d39f3e6e141622d6fea' into fix-bitf…
matthiasgoergens 65654b4
Merge commit '9f7176d360b5898003d5ca78bab1822ad67867c4' into fix-bitf…
matthiasgoergens 98767da
Fix compile
matthiasgoergens 3ca703f
Merge commit '298bcdc185d1a9709271e61a4cc529d33483add4' into fix-bitf…
matthiasgoergens c40ef7d
Merge commit 'dcaf33a41d5d220523d71c9b35bc08f5b8405dac' into fix-bitf…
matthiasgoergens d840f01
Merge commit '7e2fef865899837c47e91ef0180fa59eb03e840b' into fix-bitf…
matthiasgoergens 8b9f0eb
Merge commit 'ea94b3b149eeadf33c2f7c46f16dcda0adc7cf4e' into fix-bitf…
matthiasgoergens 4e8c220
Merge remote-tracking branch 'origin/main' into fix-bitfield-clean
matthiasgoergens 0369d0d
Fix merge
matthiasgoergens d4dc2c0
Clean up
matthiasgoergens f75d7d6
Fix tests
matthiasgoergens cdc5cdc
Merge in the main branch
encukou 0da36ad
Add Hypothesis test
encukou b6f7117
Merge in the main branch
encukou 5e47d5f
dict -> info
encukou de22b39
Conditionalize ms_struct
encukou cdd1860
Use fixed-width types in tests
encukou dd84ac3
Use subTest
encukou 8a6fb67
fixup! dict
encukou 07ea42d
Turn `info->size != info->align` assertion into a TypeError
encukou 3fa7f55
PEP 7
encukou eb2c4fb
Change _ms_struct_ to _layout_
encukou 22cd86c
Merge in the main branch
encukou 637b961
PEP 7
encukou 5309b7e
TMP
encukou 489c5c8
Add generated tests
encukou 3594473
Merge in the main branch
encukou f780496
Remove ideas
encukou 6ade022
Regen
encukou cfa6647
Do not set _layout_
encukou df162b0
We don't always get union alignment right
encukou 836a5cc
Remove unused stuff
encukou b07ae33
Packing implies ms layout
encukou 6dd7a8d
Docs & whitespace
encukou 0cf1049
Use limited API again
encukou bc91549
Appease the linter
encukou 70bbc26
Fix ReST typo
encukou 6e23b3d
Use nicer error output for memory dumps
encukou 1b90841
Regen global strings
encukou 2c4874b
Allow alignment < size, as in int64_t on x86 (32-bit), GCC layout
encukou 738323f
Add examples from MS docs
encukou af7487c
Use correct spelling for test skips
encukou 5353352
Only use 'attribute((ms_struct))' on x86_64 & ppc; on GCC and clang
encukou fe76d45
Remove the `info->size == info->align` assertion for _layout_='ms'
encukou c4714f1
Fix silly mistake in the macro
encukou c79725d
Regen
encukou cace0c9
Include field name in error message
encukou 61e92bf
Conditionally skip tests that assume sizeof(int64) == alignment(int64)
encukou ba61051
Use ms_struct only on Windows and x86/ppc GCC/clang
encukou 8991444
Use proper PyArg_ParseTuple code for Py_ssize_t
encukou bc1225b
Merge in the main branch
encukou File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
📜🤖 Added by blurb_it.
- Loading branch information
commit 23079321a6ff7093b6f34a3df7a5451e06c9f2ca
There are no files selected for viewing
1 change: 1 addition & 0 deletions
1
Misc/NEWS.d/next/C API/2022-10-01-09-56-27.gh-issue-97588.Gvg54o.rst
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Fix ctypes construction of structs from description. | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can you expand a bit here? This change could presumably impact anyone using packed bit fields through ctypes, so it would be good to mention at least some of those keywords here. A couple of sentences are okay (and feel free to add "
Contributed by <your name>"
at the end if you like - you've earned it 😉 )There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
In fact maybe a what's new entry would be appreciated too?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Maybe... "we're getting it right now" isn't the sort of thing we'd usually advertise as "new", but on the other hand, there's a good chance people have discovered it was buggy before and are now avoiding it. A note there may get noticed.
We still have someone edit what's new before it goes out, right? It won't hurt to add it, and the editor can choose whether to keep it or rephrase/reframe it.
For @matthiasgoergens, we're talking about
Doc/whatsnew/3.13.rst
as I mentioned for porting notes, but in the "Improved Modules" section (ctypes
probably needs to be added as a heading).