Fix urllib2 error handling

a few urllib2 I/O exceptions return an error object without a reason attribute. if those happen the current code dies with an unhandled exception