FAQ
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

Search Discussions

  • xDog Walker at Jun 2, 2011 at 11:40 am

    On Wednesday 2011 June 01 10:34, John Nagle wrote:
    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.

    --
    I have seen the future and I am not in it.
  • John Nagle at Jun 3, 2011 at 5:44 pm

    On 6/2/2011 4:40 AM, xDog Walker wrote:
    On Wednesday 2011 June 01 10:34, John Nagle wrote:
    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.
    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

Related Discussions

Discussion Navigation
viewthread | post
Discussion Overview
grouppython-list @
categoriespython
postedJun 1, '11 at 5:34p
activeJun 3, '11 at 5:44p
posts3
users2
websitepython.org

2 users in discussion

John Nagle: 2 posts xDog Walker: 1 post

People

Translate

site design / logo © 2022 Grokbase