[issue223] Graceful exit on XML SyntaxError

Mauricio Teixeira (netmask) at Labix Tracker tracker at labix.org
Sun Oct 8 10:19:31 PDT 2006


New submission from Mauricio Teixeira (netmask) <mteixeira at webset.net>:

(This is a followup ticket for future reference. i.e. TODO)

On channels based on XML files, when there is a syntax error or corrupted file,
Smart exists with the following error:

  File "/usr/lib/python2.4/site-packages/smart/backends/rpm/metadata.py", line 
346, in parseFilesList
    for event, elem in cElementTree.iterparse(file, ("start", "end")):
  File "<string>", line 64, in __iter__
SyntaxError: not well-formed (invalid token): line 479344, column 58

We need to find a better way of exiting with a more descriptive error message.

The first proposed solution is to catch the error on a try statement, erase the
erroneous metadata and rebuild the cache without it.

Other suggestions, or patches, are welcome.

----------
assignedto: netmask
messages: 758
nosy: netmask
priority: wish
project: smart
status: deferred
title: Graceful exit on XML SyntaxError

_______________________________________
Labix issue tracker <tracker at labix.org>
<http://tracker.labix.org/issue223>
_______________________________________



More information about the Smart mailing list