Skip to content
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

Fix type mismatch in PyXmlSec_ClearReplacedNodes for Python 3.13 compatibility #340

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

haya4ux
Copy link

@haya4ux haya4ux commented Feb 10, 2025

I’ve encountered a build failure with Python 3.13 caused by a type mismatch in the PyXmlSec_ClearReplacedNodes function. The issue arises because the variable elem is declared as a pointer-to-pointer (PyXmlSec_LxmlElementPtr*) instead of the correct pointer type (PyXmlSec_LxmlElementPtr). This misdeclaration leads to an incorrect argument being passed to Py_DECREF, which Python 3.13 now rejects due to its stricter type checking.

Changes:
• Changed the declaration of elem from PyXmlSec_LxmlElementPtr* elem; to PyXmlSec_LxmlElementPtr elem;
• Updated the cast accordingly in the call to PyXmlSec_elementFactory

Benefits:
• Resolves build errors on Python 3.13, ensuring compatibility with the latest Python release.
• Minimal and safe change that aligns with the intended design of the code.

Thank you for your continued work on this project. Please let me know if you have any questions or need further modifications.

@haya4ux
Copy link
Author

haya4ux commented Feb 10, 2025

related #335

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant