Issue 25691: Crash on deleting Element attribute (original) (raw)

This issue has been migrated to GitHub: https://github.com/python/cpython/issues/69877

classification

Title: Crash on deleting Element attribute
Type: crash Stage: resolved
Components: Extension Modules Versions: Python 3.3, Python 3.4, Python 3.5

process

Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: eli.bendersky, larry, martin.panter, python-dev, scoder, serhiy.storchaka
Priority: normal Keywords: patch

Created on 2015-11-21 17:04 by serhiy.storchaka, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
etree_del_attributes.patch serhiy.storchaka,2015-11-21 17:04 review
Messages (5)
msg255063 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-21 17:04
>>> import xml.etree.ElementTree as ET >>> e = ET.Element('tag') >>> del e.tag Segmentation fault (core dumped) Proposed patch fixes the crash.
msg255125 - (view) Author: Martin Panter (martin.panter) * (Python committer) Date: 2015-11-23 04:58
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.
msg255129 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2015-11-23 06:50
New changeset 852c9ed9115c by Serhiy Storchaka in branch '3.4': Issue #25691: Fixed crash on deleting ElementTree.Element attributes. https://hg.python.org/cpython/rev/852c9ed9115c New changeset 3a44f06907f1 by Serhiy Storchaka in branch '3.5': Issue #25691: Fixed crash on deleting ElementTree.Element attributes. https://hg.python.org/cpython/rev/3a44f06907f1 New changeset 936fcd0ba6b1 by Serhiy Storchaka in branch 'default': Issue #25691: Fixed crash on deleting ElementTree.Element attributes. https://hg.python.org/cpython/rev/936fcd0ba6b1 New changeset e3dea2e4f93d by Serhiy Storchaka in branch '2.7': Issue #25691: Added tests on deleting cElementTree.Element attributes. https://hg.python.org/cpython/rev/e3dea2e4f93d
msg255132 - (view) Author: Serhiy Storchaka (serhiy.storchaka) * (Python committer) Date: 2015-11-23 07:01
Thank you for your review Martin. Opened for documenting. Interestingly, 2.7 is free from this bug. It has a check for NULL.
msg255134 - (view) Author: Larry Hastings (larry) * (Python committer) Date: 2015-11-23 07:28
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.
History
Date User Action Args
2022-04-11 14:58:24 admin set github: 69877
2015-11-23 07:28:15 larry set nosy: + larrymessages: +
2015-11-23 07:01:10 serhiy.storchaka set status: open -> closedversions: - Python 2.7messages: + resolution: fixedstage: patch review -> resolved
2015-11-23 06:50:56 python-dev set nosy: + python-devmessages: +
2015-11-23 04:58:38 martin.panter set nosy: + martin.pantermessages: +
2015-11-21 17:04:39 serhiy.storchaka create