sgmlParser infinite loop? How to empty and re-user parser object?

Nick Arnett narnett at mccmedia.com
Thu Mar 21 23:20:33 EST 2002


Anyone know of circumstances under which sgmlParser will hang, presumably in
an infinite (well, exceeding my patience, anyway) loop?  I don't seem to be
able to reliably reproduce this, but occasionally during processing of a
large number of pages, I seem to get stuck in it.  I'm doing very simple
parsing, basically just extracting the contents of tables.  I'll re-try the
same set of documents and it'll hang in a different spot.  If it weren't so
unpredictable and infrequent, I'd dig into it with the debugger...

Still fairly new to Python... I'm wondering if I should be re-using a parser
object for each document I'm processing in a loop -- and wondering if the
fact that I'm not is causing these freezes.  But if I call it without
re-instantiating it, I get the same text parsed again... and I can't see how
to tell it to not do that.   Calling reset doesn't seem to do the trick,
even though I seem to have the appropriate reset method that calls the
parent reset.

Thanks for tips.

Nick
--
narnett at mccmedia.com
(408) 904-7198





More information about the Python-list mailing list