"""
__author__ = "Oleg Broytman <phd@phdru.name>"
-__copyright__ = "Copyright (C) 2000-2014 PhiloSoft Design"
+__copyright__ = "Copyright (C) 2000-2017 PhiloSoft Design"
__license__ = "GNU GPL"
__all__ = ['robot_urllib']
# Error 401 -- authentication required
def http_error_401(self, url, fp, errcode, errmsg, headers, data=None):
- raise IOError, ('http error', errcode, "Authentication required ", headers)
+ raise IOError(('http error', errcode, "Authentication required ", headers))
def http_error_default(self, url, fp, errcode, errmsg, headers):
if fp:
void = fp.read()
fp.close()
- raise IOError, ('http error', errcode, errmsg, headers)
+ raise IOError(('http error', errcode, errmsg, headers))
urllib._urlopener = MyURLopener()
except RedirectException, e:
return None, e.errcode, e.newurl, None, None
- except IOError, msg:
- if (msg[0] == "http error") and (msg[1] == -1):
+ except IOError, e:
+ if (e[0] == "http error") and (e[1] == -1):
error = None
bookmark.no_error = "The server did not return any header - it is not an error, actually"
self.log(' no headers: %s' % bookmark.no_error)
else:
- error = get_error(msg)
+ error = get_error(e)
self.log(' Error: %s' % error)
return error, None, None, None, None