Attributes passed to startElement misinterpreted in lxml.sax.ElementTreeContentHandler
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
lxml |
Fix Released
|
Low
|
Unassigned |
Bug Description
lxml 3.1.0, Python 2.7.3, OSX 10.8:
Python : sys.version_
lxml.etree : (2, 3, 1, 0)
libxml used : (2, 7, 8)
libxml compiled : (2, 7, 3)
libxslt used : (1, 1, 26)
libxslt compiled : (1, 1, 24)
the method ElementTreeCont
Demonstration:
document = """<?xml version="1.0" encoding="utf-8"?>
<SomeDocument xmlns:xsi="http://
<Data FooBar="123">
</Data>
</SomeDocument>
"""
from lxml import sax, etree
from xml.sax import parse
from StringIO import StringIO
# syntax is valid, etree parses it
lxml_parsed = etree.parse(
parse(StringIO(
traceback:
Traceback (most recent call last):
File "test.py", line 22, in <module>
parse(
File "/Library/
parser.
File "/Library/
xmlreader.
File "/Library/
self.
File "/Library/
self.
File "/Library/
self.
File "/Users/
self.
File "/Users/
attr_name = "{%s}%s" % name_tuple
TypeError: not enough arguments for format string
Changed in lxml: | |
milestone: | none → 3.1 |
Hmm, right, that's wrong. Would you care to come up with a fix? You can open a pull request on github for it.