discuss-gnuradio
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Discuss-gnuradio] grc should warn, not fail with malformed xml


From: Dimitris Symeonidis
Subject: [Discuss-gnuradio] grc should warn, not fail with malformed xml
Date: Fri, 3 Apr 2009 11:43:43 +0200

I am creating xml files for my RDS block, in order to be able to use
it together with GRC.
I had forgotten to close a tag in an xml file that I had put into
/usr/local/share/gnuradio/grc/platforms/python/blocks/
The result was that I couldn't run GRC anymore, it would exit with
these messages on the console:

Traceback (most recent call last):
  File "/usr/local/bin/grc", line 45, in <module>
    ActionHandler(args, Platform())
  File 
"/usr/local/lib/python2.6/dist-packages/gnuradio/grc/platforms/python/Platform.py",
line 61, in __init__
    generator=Generator,
  File 
"/usr/local/lib/python2.6/dist-packages/gnuradio/grc/platforms/base/Platform.py",
line 63, in __init__
    self._load_blocks(os.path.join(dirpath, filename))
  File 
"/usr/local/lib/python2.6/dist-packages/gnuradio/grc/platforms/base/Platform.py",
line 74, in _load_blocks
    try: ParseXML.validate_dtd(f, self._block_dtd)
  File "/usr/local/lib/python2.6/dist-packages/gnuradio/grc/utils/ParseXML.py",
line 38, in validate_dtd
    xml = etree.parse(xml_file, parser=parser)
  File "lxml.etree.pyx", line 2583, in lxml.etree.parse
(src/lxml/lxml.etree.c:25057)
  File "parser.pxi", line 1465, in lxml.etree._parseDocument
(src/lxml/lxml.etree.c:63523)
  File "parser.pxi", line 1494, in lxml.etree._parseDocumentFromURL
(src/lxml/lxml.etree.c:63767)
  File "parser.pxi", line 1394, in lxml.etree._parseDocFromFile
(src/lxml/lxml.etree.c:62923)
  File "parser.pxi", line 968, in
lxml.etree._BaseParser._parseDocFromFile (src/lxml/lxml.etree.c:60309)
  File "parser.pxi", line 542, in
lxml.etree._ParserContext._handleParseResultDoc
(src/lxml/lxml.etree.c:56659)
  File "parser.pxi", line 628, in lxml.etree._handleParseResult
(src/lxml/lxml.etree.c:57504)
  File "parser.pxi", line 568, in lxml.etree._raiseParseError
(src/lxml/lxml.etree.c:56902)
lxml.etree.XMLSyntaxError: Opening and ending tag mismatch: doc line
23 and block, line 29, column 9


Josh, shouldn't GRC ignore malformed xml files (or maybe warn),
instead of failing to run?
Sorry, I am not yet familiar enough to submit a patch for this...

Dimitris Symeonidis
"If you think you're too small to make a difference, try sleeping with
a mosquito!" - Amnesty International




reply via email to

[Prev in Thread] Current Thread [Next in Thread]