[lxml-dev] Potential bug in trunk

Anders Bruun Olsen anders at bruun-olsen.net
Thu Sep 13 13:15:37 CEST 2007


Hi,

I've run into a weird problem. I am making a CherryPy-based application
which uses lxml to do XSLT conversion of XML before sending it to the
browser. It worked fine before switching to trunk (which has the
namespace-patch that I need). Here is the output:

[13/Sep/2007:13:08:37] HTTP Serving HTTP on http://0.0.0.0:8080/
[13/Sep/2007:13:08:44]  Traceback (most recent call last):
  File "/usr/lib64/python2.4/site-packages/cherrypy/_cprequest.py", line
90, in run
    hook()
  File "/usr/lib64/python2.4/site-packages/cherrypy/_cprequest.py", line
58, in __call__
    return self.callback(**self.kwargs)
  File "/home/abo/workspace/xmldict/src/xmldict/__init__.py", line 42,
in transform_output
    xsltdoc = etree.parse(open(xslfile))
  File "etree.pyx", line 2189, in etree.parse
  File "parser.pxi", line 1183, in etree._parseDocument
  File "parser.pxi", line 1217, in etree._parseFilelikeDocument
  File "parser.pxi", line 1126, in etree._parseDocFromFilelike
  File "parser.pxi", line 83, in
etree._ParserDictionaryContext.getDefaultParser
  File "parser.pxi", line 585, in etree._BaseParser._copy
AttributeError: 'lxml.etree._ResolverRegistry' object has no attribute
'_copy'

The really weird part is that when I start up the interactive
interpreter and do the exact same operation it works:

   >>> from lxml import etree
   >>> xsltfile = "/home/abo/workspace/dicts/svda/svda.xsl"
   >>> xsltdoc = etree.parse(open(xsltfile))

Anybody able to venture a guess as to where this bug might lie? Is it in
lxml, cherrypy or my code?

-- 
Anders


More information about the lxml-dev mailing list