Fix type mismatch in PyXmlSec_ClearReplacedNodes for Python 3.13 compatibility#340
Merged
jimjag merged 1 commit intoxmlsec:masterfrom Mar 6, 2025
Merged
Fix type mismatch in PyXmlSec_ClearReplacedNodes for Python 3.13 compatibility#340jimjag merged 1 commit intoxmlsec:masterfrom
jimjag merged 1 commit intoxmlsec:masterfrom
Conversation
Author
|
related #335 |
Author
|
Hi @jimjag, @mxamin, @bgaifullin and @jonathangreen, Could you review this PR? My product relies on python3-saml and can’t upgrade to Python 3.13 due to a build failure in PyXmlSec_ClearReplacedNodes. This PR fixes the pointer mismatch that Python 3.13 flags. Thank you in advance! For reference: PR Review by Claude 3.7 |
|
Bump, have the same issue, same error, and am also relying on python3-saml. |
jonathangreen
approved these changes
Mar 4, 2025
Contributor
There was a problem hiding this comment.
@haya4ux this fix looks reasonable to me!
I'm not much help getting it merged though, I've been contributing fixes for issues I've faced, but I'm not a maintainer on this repo.
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
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.