[Twisted-Python] Lore bug

This isn't the bug I meant to report, but I found it in the process of trying to make an example of that one. So: <html><body> <pre class="python"> def foo(): print 'bar' foo() </pre> </body></html> Running lore on this file (using the PyCon template), raises this exception: Traceback (most recent call last):#######] (foo) File "/usr/local/bin/lore", line 30, in ? run() File "/home/exarkun/projects/python/Twisted/twisted/scripts/lore.py", line 87, in run w.generate() File "/home/exarkun/projects/python/Twisted/twisted/lore/process.py", line 60, in generate self.df(fullpath, linkrel) File "/home/exarkun/projects/python/Twisted/twisted/lore/default.py", line 41, in <lambda> d['baseurl'], templ) File "/home/exarkun/projects/python/Twisted/twisted/lore/tree.py", line 231, in doFile munge(doc, cn, linkrel, os.path.dirname(fn), fn, ext, url) File "/home/exarkun/projects/python/Twisted/twisted/lore/tree.py", line 201, in munge title = domhelpers.findNodesNamed(document, 'title')[0].childNodes IndexError: list index out of range Jp -- Where a calculator on the ENIAC is equipped with 18,000 vacuum tubes and weighs 30 tons, computers in the future may have only 1,000 vacuum tubes and weigh only 1.5 tons. -- Popular Mechanics, March 1949 -- up 16 days, 10:00, 7 users, load average: 0.01, 0.03, 0.00

On Wed, Mar 19, 2003 at 12:23:54PM -0500, Jp Calderone wrote:
[snip] As discussed on IRC, this is actually a feature ;) Using lint (lore -o lint) will warn that the document is malformed (in this case, missing a title tag), so Lore makes no guarantee to be able to do anything with it... I'm not interested in encouraging HTML-style "let's parse any old crud that looks vaguely recognisable". That said, giving a traceback is pretty rude. I'll patch it to give a friendly message suggesting you run lint to find out why Lore can't process your document, and probably provide a --debug, in case people still want to be able to see tracebacks (like me :). -Andrew.

On Wed, Mar 19, 2003 at 12:23:54PM -0500, Jp Calderone wrote:
[snip] As discussed on IRC, this is actually a feature ;) Using lint (lore -o lint) will warn that the document is malformed (in this case, missing a title tag), so Lore makes no guarantee to be able to do anything with it... I'm not interested in encouraging HTML-style "let's parse any old crud that looks vaguely recognisable". That said, giving a traceback is pretty rude. I'll patch it to give a friendly message suggesting you run lint to find out why Lore can't process your document, and probably provide a --debug, in case people still want to be able to see tracebacks (like me :). -Andrew.
participants (2)
-
Andrew Bennetts
-
Jp Calderone