configure urllib.urlretrieve timeout

A

Abandoned

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..
 
S

Steve Holden

Abandoned said:
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
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

No members online now.

Forum statistics

Threads
473,769
Messages
2,569,580
Members
45,054
Latest member
TrimKetoBoost

Latest Threads

Top