[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-07-13 Thread Giovanni Cappellotto
Giovanni Cappellotto added the comment: In https://github.com/python/cpython/pull/14757 I tried updating the implementation of `Attr._set_name` to remove and reset the attr node in the owner element. So now `Attr._set_name` behaves similarly to `Document.renameNode`. All existing tests are

[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-07-13 Thread Giovanni Cappellotto
Change by Giovanni Cappellotto : -- keywords: +patch pull_requests: +14552 stage: needs patch -> patch review pull_request: https://github.com/python/cpython/pull/14757 ___ Python tracker

[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-06-25 Thread Giovanni Cappellotto
Giovanni Cappellotto added the comment: I took a quick look at `minidom.py` and `test_minidom.py`. It seems that you should always use `doc.renameNode(attr, namespace, new_name)` for renaming an attribute (or an element). When `doc.renameNode` is applied on an attribute node, it removes the

[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-04-14 Thread Stefan Behnel
Stefan Behnel added the comment: The intended interface seems to be to change .name rather than .localName, so yes, that should be documented somewhere. The implementation seems a bit funny in that a "self._localName", if set, takes precedence, but there doesn't seem to be an official way to

[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-04-14 Thread Cheryl Sabella
Cheryl Sabella added the comment: Stefan, Do you think this should be documented? -- nosy: +cheryl.sabella, scoder ___ Python tracker ___

[issue13127] xml.dom.Attr.name is not labeled as read-only

2019-01-05 Thread Ashwin Ramaswami
Ashwin Ramaswami added the comment: This behavior appears to be working as expected per the documentation when using Python 3.7.1. I am able to change name, but changing localName gives me a NoModificationAllowedErr error. -- nosy: +Ashwin Ramaswami versions: +Python 3.7 -Python 2.7,

[issue13127] xml.dom.Attr.name is not labeled as read-only

2011-12-03 Thread Urjit Bhatia
Urjit Bhatia added the comment: Using the same code example as above, I added a simple print statement in the set method being defined in the defproperty and it fired correctly for - a.childNodes[0].attributes='something' **My print statement:**in defproperty set for name: attributes Traceback

[issue13127] xml.dom.Attr.name is not labeled as read-only

2011-10-14 Thread Terry J. Reedy
Terry J. Reedy added the comment: The docs are unchanged in 3.2. I presume the behavior is also. -- nosy: +terry.reedy versions: +Python 3.2, Python 3.3 ___ Python tracker ___ _

[issue13127] xml.dom.Attr.name is not labeled as read-only

2011-10-09 Thread Ezio Melotti
Ezio Melotti added the comment: localName is defined with defproperty() in Lib/xml/dom/minidom.py:464 and looking at the definition of defproperty() in Lib/xml/dom/minicompat.py:97 I think this is supposed to raise an xml.dom.NoModificationAllowedErr exception when someone tries to write on

[issue13127] xml.dom.Attr.name is not labeled as read-only

2011-10-07 Thread Dillon Amburgey
Dillon Amburgey added the comment: The behavior can be verified as follows. Notice that despite changing the value, the output XML does not change >>> from xml.dom import minidom, Node >>> a = minidom.parseString("http://asd.com\";>asd") >>> a >>> a.childNodes [] >>> a.childNodes[0] >>> a.ch

[issue13127] xml.dom.Attr.name is not labeled as read-only

2011-10-07 Thread Dillon Amburgey
New submission from Dillon Amburgey : http://docs.python.org/library/xml.dom.html#dom-attr-objects does not label the name attribute as read-only (like localName) even though it is. -- assignee: docs@python components: Documentation messages: 145155 nosy: dillona, docs@python priority: