- Python Home
- About
- News
- Documentation
- Downloads
- Community
- Foundation
- Developer's Guide
- Issue Tracker
- Issues
- Summaries
- User
- Administration
- Help
Issue15290
This issue tracker has been migrated to GitHub,
and is currently read-only.
For more information,
see the GitHub FAQs in the Python's Developer Guide.
Created on 2012-07-07 23:32 by pitrou, last changed 2022-04-11 14:57 by admin. This issue is now closed.
| Files | ||||
|---|---|---|---|---|
| File name | Uploaded | Description | Edit | |
| minidom_setattribute.patch | pitrou, 2012-07-08 12:09 | review | ||
| Messages (7) | |||
|---|---|---|---|
| msg164954 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2012-07-07 23:32 | |
This is a regression from 3.2:
Traceback (most recent call last):
File "/home/antoine/3sted/twisted/lore/test/test_lore.py", line 542, in test_setTitle
secondTitle.setAttribute('class', 'title')
File "/home/antoine/opt/lib/python3.3/xml/dom/minidom.py", line 743, in setAttribute
attr.ownerDocument = self.ownerDocument
builtins.AttributeError: ownerDocument
|
|||
| msg165007 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2012-07-08 11:57 | |
Trivial reproducer:
>>> e = minidom.Element("span")
>>> e.setAttribute("class", "version")
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/home/antoine/cpython/default/Lib/xml/dom/minidom.py", line 743, in setAttribute
attr.ownerDocument = self.ownerDocument
AttributeError: ownerDocument
|
|||
| msg165008 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2012-07-08 12:09 | |
Here is a patch. |
|||
| msg165009 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2012-07-08 12:29 | |
That's invalid usage. You are supposed to create new element nodes through the document's createElement method. "unattached" nodes are not supported. |
|||
| msg165010 - (view) | Author: Antoine Pitrou (pitrou) * ![]() |
Date: 2012-07-08 12:31 | |
> That's invalid usage. You are supposed to create new element nodes > through the document's createElement method. "unattached" nodes are > not supported. Well, I don't know how many third-party application rely on this, but Twisted does it. |
|||
| msg165011 - (view) | Author: Martin v. Löwis (loewis) * ![]() |
Date: 2012-07-08 12:58 | |
Then Twisted will have to change. From http://docs.python.org/library/xml.dom.minidom.html "Applications should not instantiate the classes themselves; they should use the creator functions available on the Document object." If they insist on not using createElement, they use internal API, and need to adjust that to new Python versions. Closing as invalid. |
|||
| msg289063 - (view) | Author: Craig Rodrigues (Craig Rodrigues) | Date: 2017-03-06 03:15 | |
Same issue was brought up in http://bugs.python.org/issue4851 |
|||
| History | |||
|---|---|---|---|
| Date | User | Action | Args |
| 2022-04-11 14:57:32 | admin | set | github: 59495 |
| 2017-03-15 10:38:12 | berker.peksag | set | superseder: xml.dom.minidom.Element.cloneNode fails with AttributeError resolution: not a bug -> duplicate stage: patch review -> resolved |
| 2017-03-06 03:15:36 | Craig Rodrigues | set | nosy:
+ Craig Rodrigues messages: + msg289063 |
| 2012-07-08 12:58:32 | loewis | set | status: open -> closed resolution: not a bug messages: + msg165011 |
| 2012-07-08 12:31:00 | pitrou | set | messages: + msg165010 |
| 2012-07-08 12:29:11 | loewis | set | messages: + msg165009 |
| 2012-07-08 12:09:01 | pitrou | set | files:
+ minidom_setattribute.patch keywords: + patch messages: + msg165008 stage: patch review |
| 2012-07-08 11:57:43 | pitrou | set | messages: + msg165007 |
| 2012-07-07 23:32:43 | pitrou | create | |


