Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.python > #6809 > unrolled thread

feedparser hanging after I/O error

Started byJohn Nagle <nagle@animats.com>
First post2011-06-01 10:34 -0700
Last post2011-06-03 10:44 -0700
Articles 3 — 2 participants

Back to article view | Back to comp.lang.python


Contents

  feedparser hanging after I/O error John Nagle <nagle@animats.com> - 2011-06-01 10:34 -0700
    Re: feedparser hanging after I/O error xDog Walker <thudfoo@gmail.com> - 2011-06-02 04:40 -0700
      Re: feedparser hanging after I/O error John Nagle <nagle@animats.com> - 2011-06-03 10:44 -0700

#6809 — feedparser hanging after I/O error

FromJohn Nagle <nagle@animats.com>
Date2011-06-01 10:34 -0700
Subjectfeedparser hanging after I/O error
Message-ID<4de67830$0$2162$742ec2ed@news.sonic.net>
   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

[toc] | [next] | [standalone]


#6857

FromxDog Walker <thudfoo@gmail.com>
Date2011-06-02 04:40 -0700
Message-ID<mailman.2390.1307015212.9059.python-list@python.org>
In reply to#6809
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.

[toc] | [prev] | [next] | [standalone]


#6956

FromJohn Nagle <nagle@animats.com>
Date2011-06-03 10:44 -0700
Message-ID<4de91d82$0$2174$742ec2ed@news.sonic.net>
In reply to#6857
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

[toc] | [prev] | [standalone]


Back to top | Article view | comp.lang.python


csiph-web