feedparser hanging after I/O error

J

John Nagle

I have a program which uses "feedparser". It occasionally hangs when
the network connection has been lost, and remains hung after the network
connection is restored.

My program calls

d = feedparser.parse(self.url,etag=self.etag,modified=self.modified)

If d is None, it raises an exception, and I see that happen when
the machine loses its WiFi connection. My program then waits about
a minute, then retries. On the retry, the same call is made, but
it never returns, even after a full day. The WiFi connection is
back up; other connections work. But "feedparser" is neither failing
nor retrying, just hanging. Note that this happens on the SECOND
failure, not the first.

Looking at the code, "feedparser" calls urllib2.opener for the
open. There's some deprecated timeout-related code in feedparser,
which I am not calling.

Running Python 2.6.3.7 (ActiveState) on Linux, on an EeePC 2G Surf.

John Nagle
 
X

xDog Walker

I have a program which uses "feedparser".  It occasionally hangs when
the network connection has been lost, and remains hung after the network
connection is restored.

My solution is to download the feed file using wget, then hand that file to
feedparser. feedparser will also hang forever on a url if the server doesn't
serve.
 
J

John Nagle

My solution is to download the feed file using wget, then hand that file to
feedparser. feedparser will also hang forever on a url if the server doesn't
serve.

Then you don't get the poll optimization, where feedparser sends the
token to indicate that it's already seen version N.

This is for a program that's constantly polling RSS feeds and
fetching changes. Feedparser is good for that, until the network
fails temporarily.

John Nagle
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,982
Messages
2,570,185
Members
46,736
Latest member
AdolphBig6

Latest Threads

Top