-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Crash on deleting Element attribute #69877
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
Comments
>>> import xml.etree.ElementTree as ET
>>> e = ET.Element('tag')
>>> del e.tag
Segmentation fault (core dumped) Proposed patch fixes the crash. |
The patch looks good to me. This may be a side effect of poor documentation. I guess the documentation at <https://docs.python.org/dev/c-api/typeobj.html#c.PyTypeObject.tp_setattro\> and/or the referenced functions should mention that the they also delete attributes when the name argument is null. |
New changeset 852c9ed9115c by Serhiy Storchaka in branch '3.4': New changeset 3a44f06907f1 by Serhiy Storchaka in branch '3.5': New changeset 936fcd0ba6b1 by Serhiy Storchaka in branch 'default': New changeset e3dea2e4f93d by Serhiy Storchaka in branch '2.7': |
Thank you for your review Martin. Opened bpo-25701 for documenting. Interestingly, 2.7 is free from this bug. It has a check for NULL. |
This change didn't make it into 3.5.1. It will be released with 3.5.2. I've already updated the Misc/NEWS entry. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: