xml comments and empty tags values raise errors on imports

Bug #161601 reported by Benoît PIN
2
Affects Status Importance Assigned to Milestone
Zope CMF buildout
Fix Released
Medium
yuppie

Bug Description

With the previous realease, it was possible to add <!-- comments --> inside xml setup files.

Now, CMFSetup.utils.ConfiguratorBase._extractNode method disallows this feature because comments tags are not handled. I think it may be nice to keep this feature. It's possible to do that by adding a test on the nodes loop (line 186) :

> for child in node.childNodes:
> name = child.nodeName
>
> if name == '#comment' :
> continue

There's also a problem with attribute-less tags which have an empty value. (typically an empty description tag for a typeinfo). A KeyError is raised in this case.

To fix that, replace (line 210) :

> if key is None:
> info = info[key]

by :

> if key is None:
> info = info.get(key, '')

Revision history for this message
yuppie (yuppie3) wrote :

Status: Pending => Accepted

 Supporters added: yuppie

Thanks for reporting this. I'll have a look at it.

Revision history for this message
yuppie (yuppie3) wrote :

Status: Accepted => Resolved

Fixed on branch and HEAD:
http://cvs.zope.org/CMF/CMFSetup/utils.py.diff?r1=1.13.2.6&r2=1.13.2.7
http://cvs.zope.org/CMF/CMFSetup/utils.py.diff?r1=1.19&r2=1.20

Note that I did not hardcode a default for all attribute-less tags as proposed, just specified one for description #text.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.