✏️ 编辑:error.cpython-39.pyc
路径:
/usr/lib64/python3.9/urllib/__pycache__/error.cpython-39.pyc
大小:2.76 KB · 修改:2026-08-12 15:51:23 · 权限:0644 · 只读(保存会失败)
← 返回目录
👁 查看
⬇ 下载
检测到二进制内容,直接保存可能损坏文件。请改用「上传替换」。
a �iH � @ sN d Z ddlZg d�ZG dd� de�ZG dd� deejj�ZG dd � d e�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 @ s e Zd Zddd�Zdd� ZdS )r Nc C s |f| _ || _|d ur|| _d S �N)�args�reason�filename)�selfr r � r �$/usr/lib64/python3.9/urllib/error.py�__init__ s zURLError.__init__c C s d| j S )Nz<urlopen error %s>)r �r r r r �__str__ s zURLError.__str__)N)�__name__� __module__�__qualname__r r r r r r r s r c @ sX e Zd ZdZejjjZdd� Zdd� Z dd� Z edd � �Zed d� �Z e jdd� �Z d S )r zBRaised when HTTP error occurs, but also acts like non-error returnc C s: || _ || _|| _|| _|| _|d ur6| �||||� d S r )�code�msg�hdrs�fpr �_HTTPError__super_init)r �urlr r r r r r r r '