Re: Python FTP timeout value not effective

2013-09-02 Thread Terry Reedy
On 9/2/2013 1:43 PM, John Nagle wrote: I'm reading files from an FTP server at the U.S. Securities and Exchange Commission. This code has been running successfully for years. Recently, they imposed a consistent connection delay of 20 seconds at FTP connection, presumably because they're ha

Re: Python FTP timeout value not effective

2013-09-02 Thread Chris Angelico
On Tue, Sep 3, 2013 at 3:43 AM, John Nagle wrote: > "URLError: failed because the connected party did not properly respond after a > period of time, or established connection failed because connected host > has failed to respond>" > > But in both cases, the command line FTP client will work, afte

Re: Python FTP timeout value not effective

2013-09-02 Thread David Bolen
John Nagle writes: > Here's the relevant code: > > TIMEOUTSECS = 60 ## give up waiting for server after 60 seconds > ... > def urlopen(url,timeout=TIMEOUTSECS) : > if url.endswith(".gz") : # gzipped file, must decompress first > nd = urllib2.urlopen(url,timeout=timeout) # ge