views:

20

answers:

0
class DefaultErrorHandler(urllib2.HTTPDefaultErrorHandler):    1
    def http_error_default(self, req, fp, code, msg, headers): 2
        result = urllib2.HTTPError(                           
            req.get_full_url(), code, msg, headers, fp)       
        result.status = code                                   3
        return result

If you add a header to urllib2.Request('any url'), with the dictionary value as headers.get'last-modified', it should stop the error text but it doesn't. Please can anyone tell me what's wrong with it?