[Tutor] FTP Bug?

Britt Green britt_green@hotmail.com
Sun, 18 Mar 2001 23:30:56 -0800


Hmm...its odd because it'll do this randomly from time to time, not in the 
same place each time. The most idle my program gets is about five to ten 
seconds while it figures out the average size of the directory.

I'm probably going to post the code of my program here in the next few days. 
When I do, if anyone sees anything that mighht cause this, please let me 
know.

Britt


>From: Daniel Yoo <dyoo@hkn.eecs.berkeley.edu>
>To: Britt Green <britt_green@hotmail.com>
>CC: tutor@python.org
>Subject: Re: [Tutor] FTP Bug?
>Date: Sun, 18 Mar 2001 05:44:30 -0800 (PST)
>
>On Sat, 17 Mar 2001, Britt Green wrote:
>
> > Well, my FTP program that I've been working on is almost done. It
> > works...almost! Occasionally when I run it I get this error message:
>
> > error: (10054, 'Connection reset by peer')
>
>If your FTP program is idle (the adjective, not the editor), I think ftp
>servers are free to reset the connection, since it looks like it's not
>being used.
>
>Not quite sure what do to about this, as even Internet Explorer shows this
>to me every once in a while.  *grin* My suggestion is to use a try/except
>block to detect this situation, and if it occurs, to try to reestablish
>the connection and go for it again.  So something like:
>
>###
>try:
>     ## Do stuff
>except socket.error:
>     if not reestablishConnection(): print "Oh no!"
>###
>
>(Although there's probably a little more code involved than this.)  Hope
>this helps!
>

_________________________________________________________________
Get your FREE download of MSN Explorer at http://explorer.msn.com