Permalink
Browse files

Don't feed empty strings in getXMLSerializer, with some versions of l…

…ibxml2 this seems to cause problems.
  • Loading branch information...
1 parent f555d86 commit c7fc53ce7a493c1b21bb4180adfb065a2fe75073 @lrowe committed Sep 11, 2010
Showing with 6 additions and 1 deletion.
  1. +4 −0 CHANGES.txt
  2. +2 −1 repoze/xmliter/utils.py
View
@@ -4,6 +4,10 @@ Changelog
0.2 - unreleased
----------------
+* Don't feed empty strings in getXMLSerializer, with some versions of libxml2
+ this seems to cause problems.
+ [Laurence]
+
* Defer to xsl:output settings when serializing an XSLResultTree.
[Laurence]
View
@@ -12,7 +12,8 @@ def getXMLSerializer(iterable, parser=etree.XMLParser, serializer=etree.tostring
p = parser(encoding=encoding)
for chunk in iterable:
- p.feed(chunk)
+ if chunk:
+ p.feed(chunk)
root = p.close()
return XMLSerializer(root.getroottree(), serializer, pretty_print)

0 comments on commit c7fc53c

Please sign in to comment.