B €/g^H c@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. iNÚURLErrorÚ HTTPErrorÚContentTooShortErrorc@seZdZddd„Zdd„ZdS)rNcCs |f|_||_|dk r||_dS©N)ZargsÚreasonÚfilename)Úselfrr©rú$/usr/lib64/python3.7/urllib/error.pyÚ__init__szURLError.__init__cCs d|jS)Nz)r©rrrrÚ__str__ózURLError.__str__r)Ú__name__Ú __module__Ú __qualname__r r rrrrrs 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| ||||¡dSr)ÚcodeÚmsgÚhdrsÚfprÚ_HTTPError__super_init)rZurlrrrrrrrr 'szHTTPError.__init__cCód|j|jfS)NzHTTP Error %s: %s©rrr rrrr 4r zHTTPError.__str__cCr)Nzrr rrrÚ__repr__7r zHTTPError.__repr__cCó|jSr)rr rrrr<ózHTTPError.reasoncCrr©rr rrrÚheaders@rzHTTPError.headerscCs ||_dSrr)rrrrrrDrN)r rrÚ__doc__ÚurllibÚresponseÚ addinfourlr rr rZpropertyrrZsetterrrrrr#s    c@seZdZdZdd„ZdS)rzDException raised when downloaded size does not match content-length.cCst ||¡||_dSr)rr Úcontent)rZmessager rrrr Ks zContentTooShortError.__init__N)r rrrr rrrrrIs) rZurllib.responserZ__all__ZOSErrorrrrrrrrrrZ s  &