-
-
Notifications
You must be signed in to change notification settings - Fork 30.4k
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
bpo-46784: Add newly exported expat symbols to the namespace. #31397
Conversation
Should I create a news entry in the "Core and Builtins" category? |
I don't remember the categories, extension modules or library would be my first choices as this only impacts the xml modules which should be dynamically loaded in most people's builds. if those don't exist core and builtins is fine. the main thing is having a news entry. :) |
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.
I'm not sure about the case of dynamically using an older version.
I want to ask for advice.
This PR is just continuing what CPython pyexpatns.h already does to avoid symbol conflicts between its own embedded C expat and anyone else linking in their own expat. It comes up in embedding contexts where CPython is linked into a C/C++ application that also uses upstream expat itself. It'd presumably also be possible when a C/C++ extension module uses expat itself. Dynamically, without this, code either uses the first version loaded or there's a duplicate symbol error upon loading the extension module using the second version. Which problem, if any, probably depends on exactly how things are linked. |
@gpshead Thank you for explain :) |
I would like to note that these three^^ are not considered public API and that Expat's own two build systems (CMake and GNU Autotools) tell the linker which symbols are public and hide everything else. Maybe you'll decide that doesn't matter, but I wanted to be sure it's clear these are not public symbols of Expat.
I still hope that someone can make those two^^ accessible (with additional glue code) to the user on pyexpat level in CPython. |
I filed https://bugs.python.org/issue46793 to at least track that. |
regarding the symbol exports, as we're renaming them to not conflict I doubt it matters much - though it is effectively dead code in the shared library. Avoiding export requires modifying how the module gets linked, probably via flags in setup.py and possibly the |
@gpshead not
That sounds healthy 👍 |
News entry added. |
@yilei: Status check is done, and it's a success ✅ . |
Thanks @yilei for the PR 🌮🎉.. I'm working now to backport this PR to: 3.9, 3.10. |
GH-31417 is a backport of this pull request to the 3.9 branch. |
…GH-31397) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
Thanks @yilei for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7. |
Thanks @yilei for the PR 🌮🎉.. I'm working now to backport this PR to: 3.8. |
GH-31418 is a backport of this pull request to the 3.7 branch. |
GH-31419 is a backport of this pull request to the 3.8 branch. |
…GH-31397) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
Thanks @yilei for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
Thanks @yilei for the PR 🌮🎉.. I'm working now to backport this PR to: 3.10. |
…GH-31397) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
…ythonGH-31397) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
GH-31420 is a backport of this pull request to the 3.10 branch. |
…H-31397) (GH-31420) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com> Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
…) (GH-31418) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
…GH-31397) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
…) (GH-31419) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
…GH-31397) The libexpat 2.4.1 upgrade from introduced the following new exported symbols: * `testingAccountingGetCountBytesDirect` * `testingAccountingGetCountBytesIndirect` * `unsignedCharToPrintable` * `XML_SetBillionLaughsAttackProtectionActivationThreshold` * `XML_SetBillionLaughsAttackProtectionMaximumAmplification` We need to adjust [Modules/expat/pyexpatns.h](https://github.com/python/cpython/blob/master/Modules/expat/pyexpatns.h) (The newer libexpat upgrade has no new symbols). Automerge-Triggered-By: GH:gpshead (cherry picked from commit 6312c10) Co-authored-by: Yilei "Dolee" Yang <yileiyang@google.com>
The libexpat 2.4.1 upgrade from https://bugs.python.org/issue44394 introduced the following new exported symbols:
testingAccountingGetCountBytesDirect
testingAccountingGetCountBytesIndirect
unsignedCharToPrintable
XML_SetBillionLaughsAttackProtectionActivationThreshold
XML_SetBillionLaughsAttackProtectionMaximumAmplification
We need to adjust Modules/expat/pyexpatns.h
(The newer libexpat upgrade https://bugs.python.org/issue46400 has no new symbols).
https://bugs.python.org/issue46784
Automerge-Triggered-By: GH:gpshead