--- etree.pyx.orig 2005-06-18 10:19:51.163457856 +0300 +++ etree.pyx 2005-06-18 10:20:18.919238336 +0300 @@ -980,8 +980,8 @@ # XXX ignore parser for now cdef xmlDoc* c_doc - # XXX simplistic StringIO support - if isinstance(source, StringIO): + # XXX simplistic approach to support StringIO/cStringIO + if hasattr(source, 'getvalue'): c_doc = theParser.parseDoc(source.getvalue()) return _elementTreeFactory(c_doc)