471,337 Members | 813 Online
Bytes | Software Development & Data Engineering Community
Post +

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 471,337 software developers and data experts.

configure urllib.urlretrieve timeout

Hi..
I want to set 30 second urllib.urlretrieve timeout..
Because if urllib.urlretrieve can't connect to page wait 1-2 hour...
I download the images to my server with urlretrieve if you know the
better way please help me.

I'm sorry my bad english..

Oct 7 '07 #1
1 11588
Abandoned wrote:
Hi..
I want to set 30 second urllib.urlretrieve timeout..
Because if urllib.urlretrieve can't connect to page wait 1-2 hour...
I download the images to my server with urlretrieve if you know the
better way please help me.

I'm sorry my bad english..
import socket
socket.setdefaulttimeout(30)

at the top of your program might help.

regards
Steve
--
Steve Holden +1 571 484 6266 +1 800 494 3119
Holden Web LLC/Ltd http://www.holdenweb.com
Skype: holdenweb http://del.icio.us/steve.holden

Sorry, the dog ate my .sigline so I couldn't cat it

Oct 7 '07 #2

This discussion thread is closed

Replies have been disabled for this discussion.

Similar topics

1 post views Thread by Chris Lyon | last post: by
2 posts views Thread by Andreas Dahl | last post: by
2 posts views Thread by Sam Sungshik Kong | last post: by
8 posts views Thread by Ritesh Raj Sarraf | last post: by
1 post views Thread by Timothy Smith | last post: by
6 posts views Thread by justsee | last post: by
5 posts views Thread by supercooper | last post: by
5 posts views Thread by John Nagle | last post: by
5 posts views Thread by chrispoliquin | last post: by

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.