Q:

Ignoring exceptions urllib.urlretrieve() in Python 2.7.2

I have a list of download URL's, some of which are false. I'm using 
urllib.urlretrieve() in Python 2.7.2

to download and to save files. I want to be able to ignore the false URLs and continue the download routine. I want to be able to ignore other exceptions too. Like when the URL is OK but the file name does not comply with naming conventions, or the download is taking too long because of network problems etc.
Please help.

A:

You can use try/except in python:
try:
  # do your urllib.urlretrieve() call here.
except: 
  pass

