diff options
author | Sebastian Pipping <sebastian@pipping.org> | 2024-03-06 17:55:07 (GMT) |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-03-06 17:55:07 (GMT) |
commit | 8a8e9204d1f737fa5dc6f5087411bdbe8139d3b2 (patch) | |
tree | c5105fa0fd1a16d25034aa836fcf55a15cb1004d /Include | |
parent | c012c8ab7bb72a733bd98be5df32e262b9045f1a (diff) | |
download | cpython-8a8e9204d1f737fa5dc6f5087411bdbe8139d3b2.zip cpython-8a8e9204d1f737fa5dc6f5087411bdbe8139d3b2.tar.gz cpython-8a8e9204d1f737fa5dc6f5087411bdbe8139d3b2.tar.bz2 |
gh-115398: Revert `PyExpat_CAPI_MAGIC` version bump (GH-116411)
Revert "gh-115398: Increment PyExpat_CAPI_MAGIC for SetReparseDeferralEnabled addition (GH-116301)"
This reverts part of commit eda2963378a3c292cf6bb202bb00e94e46ee6d90. Why? this comment buried in an earlier code review explains:
I checked again how that value is used in practice, it's here:
https://github.com/python/cpython/blob/0c80da4c14d904a367968955544dd6ae58c8101c/Modules/_elementtree.c#L4363-L4372
Based on that code my understanding is that loading bigger structs from the future is considered okay unless `PyExpat_CAPI_MAGIC` differs, which implies that (1) magic needs to stay the same to support loading the future from the past and (2) that `PyExpat_CAPI_MAGIC` should only ever change for changes that do not increase size (but keep it constant).
To summarize, that supports your argument.
I checked branches 3.8, 3.9, 3.10, 3.11, 3.12 now and they all have the same comparison code there so reverting that magic string bump will support seamless backporting.
Diffstat (limited to 'Include')
-rw-r--r-- | Include/pyexpat.h | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/Include/pyexpat.h b/Include/pyexpat.h index e0cff33..9824d09 100644 --- a/Include/pyexpat.h +++ b/Include/pyexpat.h @@ -3,7 +3,7 @@ /* note: you must import expat.h before importing this module! */ -#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.2" +#define PyExpat_CAPI_MAGIC "pyexpat.expat_CAPI 1.1" #define PyExpat_CAPSULE_NAME "pyexpat.expat_CAPI" struct PyExpat_CAPI |