o ?Ogo @sVdZddlZddlZgdZGdddeZGdddeejjZ Gdd d eZ dS) aException 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 HTTPErrorContentTooShortErrorc@seZdZdddZddZdS)rNcCs$|f|_||_|dur||_dSdSN)argsreasonfilename)selfrrr 3/opt/alt/python310/lib64/python3.10/urllib/error.py__init__s  zURLError.__init__cCs d|jS)Nz)rr r r r __str__s zURLError.__str__r)__name__ __module__ __qualname__r rr r r r rs  rc@sXeZdZdZejjjZddZddZ ddZ e dd Z e d d Z e jd d Z d S)rzBRaised when HTTP error occurs, but also acts like non-error returncCsB||_||_||_||_||_|durt}|||||dSr)codemsghdrsfprioBytesIO_HTTPError__super_init)r Zurlrrrrr r r r 'szHTTPError.__init__cCd|j|jfS)NzHTTP Error %s: %srrr r r r r1zHTTPError.__str__cCr)Nzrr r r r __repr__4rzHTTPError.__repr__cC|jSr)rr r r r r9zHTTPError.reasoncCrrrr r r r headers=rzHTTPError.headerscCs ||_dSrr)r r r r r r As N)rrr__doc__urllibresponse addinfourlr rrrpropertyrr setterr r r r r#s    rc@seZdZdZddZdS)rzDException raised when downloaded size does not match content-length.cCst||||_dSr)rr content)r messager'r r r r Hs  zContentTooShortError.__init__N)rrrr!r r r r r rFs r) r!rZurllib.responser"__all__OSErrorrr#r$rrr r r r s #