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.

Author bobince
Recipients
Date 2005-03-11.08:25:14
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=311085

Bug should be marked INVALID.

childNodes lists are 'live'. You are iterating over a list
you are destroying at the same time. The code is equivalent
to the more obviously broken:

  foo= [1, 2, 3, 4]
  i= 0
  while i<len(foo):
    del foo[i]
    i+= 1
  foo
  >>> [2, 4]

The 'working' example only works because it has extra
whitespace nodes in, so when you delete child number i, the
child i+1 that is skipped over is a Text node containing
only whitespace.

BTW, there's a separate bug tracker for the PyXML project
from which minidom is taken. You may get better results by
submitting there (and discussing on the XML-SIG list).
History
Date User Action Args
2007-08-23 14:29:57adminlinkissue1157901 messages
2007-08-23 14:29:57admincreate