Skip to content

Commit 6312c10

Browse files
authored
bpo-46784: Add newly exported expat symbols to the namespace. (pythonGH-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
1 parent 892ff93 commit 6312c10

File tree

2 files changed

+6
-0
lines changed

2 files changed

+6
-0
lines changed
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Fix libexpat symbols collisions with user dynamically loaded or statically linked libexpat in embedded Python.

Modules/expat/pyexpatns.h

+5
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,9 @@
3838
#ifndef PYEXPATNS_H
3939
#define PYEXPATNS_H
4040

41+
#define testingAccountingGetCountBytesDirect PyExpat_testingAccountingGetCountBytesDirect
42+
#define testingAccountingGetCountBytesIndirect PyExpat_testingAccountingGetCountBytesIndirect
43+
#define unsignedCharToPrintable PyExpat_unsignedCharToPrintable
4144
#define XML_DefaultCurrent PyExpat_XML_DefaultCurrent
4245
#define XML_ErrorString PyExpat_XML_ErrorString
4346
#define XML_ExpatVersion PyExpat_XML_ExpatVersion
@@ -81,6 +84,8 @@
8184
#define XML_ResumeParser PyExpat_XML_ResumeParser
8285
#define XML_SetAttlistDeclHandler PyExpat_XML_SetAttlistDeclHandler
8386
#define XML_SetBase PyExpat_XML_SetBase
87+
#define XML_SetBillionLaughsAttackProtectionActivationThreshold PyExpat_XML_SetBillionLaughsAttackProtectionActivationThreshold
88+
#define XML_SetBillionLaughsAttackProtectionMaximumAmplification PyExpat_XML_SetBillionLaughsAttackProtectionMaximumAmplification
8489
#define XML_SetCdataSectionHandler PyExpat_XML_SetCdataSectionHandler
8590
#define XML_SetCharacterDataHandler PyExpat_XML_SetCharacterDataHandler
8691
#define XML_SetCommentHandler PyExpat_XML_SetCommentHandler

0 commit comments

Comments
 (0)