gh-57336: Fix attr name setter behavior - #14757
Open
potomak wants to merge 2 commits into
Open
Conversation
Update the implementation of attributes `name` setter to correctly replace the attribute in the owner element. The update is divided in three main steps: 1. update the implementation of `Attr._set_name` to behave more similarly to `Document.renameNode` 2. update the implementation of `Document.renameNode` to use `Attr._set_name` if the node is of type "attribute" 3. create a new function `_parseName`, that is used in both `Attr._set_name` and `Document.renameNode`, to reduce code duplication
|
The following commit authors need to sign the Contributor License Agreement: |
|
This PR is stale because it has been open for 30 days with no activity. |
Member
|
@potomak, please sign the CLA (just click the button and follow instructions). We need this to be able to merge this PR. |
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.
Update the implementation of attributes
namesetter to correctlyreplace the attribute in the owner element.
The update is divided in three main steps:
update the implementation of
Attr._set_nameto behave moresimilarly to
Document.renameNodeupdate the implementation of
Document.renameNodeto useAttr._set_nameif the node is of type "attribute"create a new function
_parseName, that is used in bothAttr._set_nameandDocument.renameNode, to reduce codeduplication
https://bugs.python.org/issue13127