[4suite] bug: Element.removeAttributeNS throws wrong exception

Alexandre Fayolle alf at logilab.com
Mon Sep 4 06:50:55 MDT 2000


Hello, I got this traceback after removing an attribute which doesn't
exist :

  File "lib/gui/PropertyEditor.py", line 146, in update
    element.removeAttributeNS('',attr)
  File "/home/alf/xmlSig/repository/xml/xml/dom/Element.py", line 245, in
removeAttributeNS
    old = self.attributes.removeNamedItemNS(namespaceURI,localName)
  File "/home/alf/xmlSig/repository/xml/xml/dom/NamedNodeMap.py", line
171, in removeNamedItemNS
    raise DOMException(NOT_FOUND_ERR)
xml.dom.DOMException


However, according to the DOM2 recomendation, removeAttributeNS is not
supposed to raise this exception (it can only raise a
NO_MODIFICATION_ALLOWED_ERR if the node is readonly), so I think there
should be a try... except block around line 245 in Element.py.

-- 
Alexandre Fayolle
Logilab




More information about the 4suite mailing list