✏️ 正在编辑: error.cpython-312.pyc
路径:
/lib64/python3.12/urllib/__pycache__/error.cpython-312.pyc
提示:
您可以编辑任何文件(包括二进制文件),但请注意不当修改可能导致文件损坏。
� �֦io � � � d Z ddlZddlZg d�Z G d� de� Z G d� deej j � Z G d� d e� Z y) 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 � � e Zd Zdd�Zd� Zy)r Nc �6 � |f| _ || _ |�|| _ y y �N)�args�reason�filename)�selfr r s �%/usr/lib64/python3.12/urllib/error.py�__init__zURLError.__init__ s$ � ��G�� ������$�D�M� � c � � d| j z S )Nz<urlopen error %s>)r �r s r �__str__zURLError.__str__ s � �#�d�k�k�1�1r r )�__name__� __module__�__qualname__r r � r r r r s � �%�2r r c � � e Zd ZdZej j j Zd� Zd� Z d� Z ed� � Zed� � Z e j d� � Z y) r zBRaised when HTTP error occurs, but also acts like non-error returnc � � || _ || _ || _ || _ || _ |�t j � }| j ||||� y r )�code�msg�hdrs�fpr �io�BytesIO�_HTTPError__super_init)r �urlr r r r s r r zHTTPError.__init__'