Message6566
When using sax.parse, attributes passed to startElement are broken if an element has an attribute with name 'id'. This can be demonstrated with the attached script. Below is the output I get with Jython 2.5.2:
$ jython saxbug.py
attr : idx
value : 1
attr : (u'i', u'd')
value :
Traceback (most recent call last):
File "saxbug.py", line 11, in <module>
sax.parse(StringIO('<tag id="1"/>'), Handler())
File "/home/peke/Prog/jython2.5.2/Lib/xml/sax/__init__.py", line 34, in parse
parser.parse(source)
File "/home/peke/Prog/jython2.5.2/Lib/xml/sax/drivers2/drv_javasax.py", line 146, in parse
self._parser.parse(JyInputSourceWrapper(source))
File "/home/peke/Prog/jython2.5.2/Lib/xml/sax/drivers2/drv_javasax.py", line 187, in startElement
self._cont_handler.startElement(qname, self._attrs)
File "saxbug.py", line 8, in startElement
print 'value :', attrs.values()[0]
File "/home/peke/Prog/jython2.5.2/Lib/xml/sax/drivers2/drv_javasax.py", line 311, in values
return map(self.getValue, self.getNames())
File "/home/peke/Prog/jython2.5.2/Lib/xml/sax/drivers2/drv_javasax.py", line 266, in getValue
value = self._attrs.getValue(_makeJavaNsTuple(name))
TypeError: getValue(): 1st arg can't be coerced to String, int |
|
Date |
User |
Action |
Args |
2011-07-11 22:45:33 | pekka.klarck | set | recipients:
+ pekka.klarck |
2011-07-11 22:45:33 | pekka.klarck | set | messageid: <1310424333.12.0.381524191089.issue1768@psf.upfronthosting.co.za> |
2011-07-11 22:45:33 | pekka.klarck | link | issue1768 messages |
2011-07-11 22:45:32 | pekka.klarck | create | |
|