3 \Q ã@sPdZddlZdddgZGdd„deƒZGdd„deejjƒZGdd„deƒZ dS) aïException classes raised by urllib. The base exception class is URLError, which inherits from OSError. It doesn't define any behavior of its own, but is the base class for all exceptions defined in this package. HTTPError is an exception class that is also a valid HTTP response instance. It behaves this way because HTTP protocol errors are valid responses, with a status code, headers, and a body. In some contexts, an application may want to handle an exception like a regular response. éNÚURLErrorÚ HTTPErrorÚContentTooShortErrorc@seZdZddd„Zdd„ZdS)rNcCs |f|_||_|dk r||_dS)N)ÚargsÚreasonÚfilename)Úselfrr©r ú/usr/lib64/python3.6/error.pyÚ__init__szURLError.__init__cCs d|jS)Nz)r)rr r r Ú__str__szURLError.__str__)N)Ú__name__Ú __module__Ú __qualname__r r r r r r rs c@sXeZdZdZejjjZdd„Zdd„Z dd„Z e dd „ƒZ e d d „ƒZ e jd d „ƒZ d S)rzBRaised when HTTP error occurs, but also acts like non-error returncCs:||_||_||_||_||_|dk r6|j||||ƒdS)N)ÚcodeÚmsgÚhdrsÚfprÚ_HTTPError__super_init)rZurlrrrrr r r r 'szHTTPError.__init__cCsd|j|jfS)NzHTTP Error %s: %s)rr)rr r r r 4szHTTPError.__str__cCsd|j|jfS)Nz)rr)rr r r Ú__repr__7szHTTPError.__repr__cCs|jS)N)r)rr r r r<szHTTPError.reasoncCs|jS)N)r)rr r r Úheaders@szHTTPError.headerscCs ||_dS)N)r)rrr r r rDsN)r rrÚ__doc__ÚurllibÚresponseÚ addinfourlr rr rÚpropertyrrÚsetterr r r r r#s    c@seZdZdZdd„ZdS)rzDException raised when downloaded size does not match content-length.cCstj||ƒ||_dS)N)rr Úcontent)rÚmessagerr r r r Ks zContentTooShortError.__init__N)r rrrr r r r r rIs) rZurllib.responserÚ__all__ÚOSErrorrrrrrr r r r Ú s  &