mirror of
https://github.com/davidhalter/typeshed.git
synced 2025-12-10 05:51:52 +08:00
http/html stubtest fixes (#5208)
This commit is contained in:
@@ -3,6 +3,7 @@ import io
|
||||
import ssl
|
||||
import sys
|
||||
import types
|
||||
from _typeshed import WriteableBuffer
|
||||
from socket import socket
|
||||
from typing import (
|
||||
IO,
|
||||
@@ -103,6 +104,9 @@ class HTTPResponse(io.BufferedIOBase, BinaryIO):
|
||||
reason: str
|
||||
def __init__(self, sock: socket, debuglevel: int = ..., method: Optional[str] = ..., url: Optional[str] = ...) -> None: ...
|
||||
def read(self, amt: Optional[int] = ...) -> bytes: ...
|
||||
def read1(self, n: int = ...) -> bytes: ...
|
||||
def readinto(self, b: WriteableBuffer) -> int: ...
|
||||
def readline(self, limit: int = ...) -> bytes: ... # type: ignore
|
||||
@overload
|
||||
def getheader(self, name: str) -> Optional[str]: ...
|
||||
@overload
|
||||
@@ -198,14 +202,25 @@ error = HTTPException
|
||||
|
||||
class NotConnected(HTTPException): ...
|
||||
class InvalidURL(HTTPException): ...
|
||||
class UnknownProtocol(HTTPException): ...
|
||||
|
||||
class UnknownProtocol(HTTPException):
|
||||
def __init__(self, version: str) -> None: ...
|
||||
|
||||
class UnknownTransferEncoding(HTTPException): ...
|
||||
class UnimplementedFileMode(HTTPException): ...
|
||||
class IncompleteRead(HTTPException): ...
|
||||
|
||||
class IncompleteRead(HTTPException):
|
||||
def __init__(self, partial: bytes, expected: Optional[int] = ...) -> None: ...
|
||||
|
||||
class ImproperConnectionState(HTTPException): ...
|
||||
class CannotSendRequest(ImproperConnectionState): ...
|
||||
class CannotSendHeader(ImproperConnectionState): ...
|
||||
class ResponseNotReady(ImproperConnectionState): ...
|
||||
class BadStatusLine(HTTPException): ...
|
||||
class LineTooLong(HTTPException): ...
|
||||
|
||||
class BadStatusLine(HTTPException):
|
||||
def __init__(self, line: str) -> None: ...
|
||||
|
||||
class LineTooLong(HTTPException):
|
||||
def __init__(self, line_type: str) -> None: ...
|
||||
|
||||
class RemoteDisconnected(ConnectionResetError, BadStatusLine): ...
|
||||
|
||||
Reference in New Issue
Block a user