Hello,
 
I’m trying to use xml2py (for the first time) in ctypes v 0.9.9.9.
 
I’ve generated what appears to be a valid xml file from a c header file.
 
Next, I attempt to run xml2py and get a python keyerror exception from the gccxmlparser.py module.
 
Does this error suggest that my xml file needs an attribute “size” that doesn’t exist?
 
Can anyone offer any suggestions?
 
Thanks in advance,
 
Here’s the traceback information:
 
C:\>python xml2py.py nivision.xml -o nivision.py
Traceback (most recent call last):
  File "xml2py.py", line 173, in ?
    sys.exit(main())
  File "xml2py.py", line 169, in main
    types=options.kind)
  File "C:\Python24\Lib\site-packages\ctypes\wrap\codegenerator.py", line 791, in generate_code
    items = parse(xmlfile)
  File "C:\Python24\Lib\site-packages\ctypes\wrap\gccxmlparser.py", line 382, in parse
    xml.sax.parse(xmlfile, handler)
  File "C:\Python24\lib\xml\sax\__init__.py", line 33, in parse
    parser.parse(source)
  File "c:\python24\lib\xml\sax\expatreader.py", line 107, in parse
    xmlreader.IncrementalParser.parse(self, source)
  File "C:\Python24\lib\xml\sax\xmlreader.py", line 123, in parse
    self.feed(buffer)
  File "c:\python24\lib\xml\sax\expatreader.py", line 207, in feed
    self._parser.Parse(data, isFinal)
  File "c:\python24\lib\xml\sax\expatreader.py", line 300, in start_element
    self._cont_handler.startElement(name, AttributesImpl(attrs))
  File "C:\Python24\Lib\site-packages\ctypes\wrap\gccxmlparser.py", line 43, in startElement
    result = mth(attrs)
  File "C:\Python24\Lib\site-packages\ctypes\wrap\gccxmlparser.py", line 236, in Enumeration
    size = attrs["size"]
  File "C:\Python24\lib\xml\sax\xmlreader.py", line 316, in __getitem__
    return self._attrs[name]
KeyError: 'size'
 
Jeff
 


Talk is cheap. Use Yahoo! Messenger to make PC-to-Phone calls. Great rates starting at 1˘/min.