Upgrading websockets 16 to 17
Unknown16.1.1 → 17.4
UnknownUpgrade verdict
DepDelta found no changes in this range's notes, so it can't call it safe.
In plain terms
- The notes in this range list no changes DepDelta could read.
- Read the commits and the notes before upgrading.
Must act No changes found in the notes
That doesn't make this range safe. Read the notes and the commits before upgrading.
Python requirement changed in 17.0: >=3.10 → >=3.11.
API changes
Generated by DepDelta from published Python source. Not mixed with prose notes.
- added:
export HeaderLineTooLong - added:
export InvalidMethod - added:
export InvalidProtocol - added:
export RequestLineTooLong - added:
export StatusLineTooLong - added:
export TooManyFragments - added:
export TooManyHeaders
- removed:
class Timeout - removed:
constructor Timeout(deadline: Optional[float], loop: asyncio.AbstractEventLoop) -> None - removed:
function timeout(delay: Optional[float]) -> Timeout - removed:
function timeout_at(deadline: Optional[float]) -> Timeout - removed:
method Timeout.reject() -> None - removed:
method Timeout.shift(delay: float) -> None - removed:
method Timeout.update(deadline: float) -> None - removed:
property Timeout.deadline -> Optional[float] - removed:
property Timeout.expired -> bool
- removed:
async method connect.create_connection() -> ClientConnection - changed:
function unix_connect(path: str | None=…, uri: str | None=…, **kwargs: Any) -> connect → function unix_connect(path: PathLike | None=…, uri: str | None=…, **kwargs: Any) -> connect - added:
async method connect.connect() -> ClientConnection - added:
async method connect.open_tcp_connection() -> ClientConnection
- removed:
async function anext(async_iterator) - removed:
export TimeoutError - removed:
export asyncio_timeout - removed:
export asyncio_timeout_at - removed:
function aiter(async_iterable) - removed:
variable TimeoutError - removed:
variable aiter - removed:
variable anext
- removed:
method Connection.set_recv_exc(exc: BaseException | None) -> None - changed:
async method Connection.send(message: DataLike | Iterable[DataLike] | AsyncIterable[DataLike], text: bool | None=…) -> None → async method Connection.send(message: DataLike | Iterable[DataLike] | AsyncIterable[DataLike], *, text: bool | None=…) -> None - added:
method Connection.set_connection_exc(exc: BaseException | None) -> None - added:
property Connection.close_exc -> ConnectionClosed
- changed:
function route(url_map: Map, *args: Any, server_name: str | None=…, ssl: ssl_module.SSLContext | Literal[True] | None=…, create_router: type[Router] | None=…, **kwargs: Any) -> Awaitable[Server] → function route(url_map: Map, *args: Any, server_name: str | None=…, ssl: ssl_module.SSLContext | Literal[True] | None=…, create_router: type[Router] | None=…, **kwargs: Any) -> Server - changed:
function unix_route(url_map: Map, path: str | None=…, **kwargs: Any) -> Awaitable[Server] → function unix_route(url_map: Map, path: PathLike | None=…, **kwargs: Any) -> Server
- removed:
async method Server.conn_handler(connection: ServerConnection) -> None - removed:
class serve - removed:
constructor serve(handler: Callable[[ServerConnection], Awaitable[None]], host: str | None=…, port: int | None=…, *, origins: Sequence[Origin | re.Pattern[str] | None] | None=…, extensions: Sequence[ServerExtensionFactory] | None=…, subprotocols: Sequence[Subprotocol] | None=…, select_subprotocol: Callable[[ServerConnection, Sequence[Subprotocol]], Subprotocol | None] | None=…, compression: str |… - removed:
method Server.start_connection_handler(connection: ServerConnection) -> None - removed:
method Server.wrap(server: asyncio.Server) -> None - changed:
constructor Server(handler: Callable[[ServerConnection], Awaitable[None]], *, process_request: Callable[[ServerConnection, Request], Awaitable[Response | None] | Response | None] | None=…, process_response: Callable[[ServerConnection, Request, Response], Awaitable[Response | None] | Response | None] | None=…, server_header: str | None=…, open_timeout: float | None=…, logger: LoggerLike | None=…)… → constructor Server(create_server: Callable[[], Coroutine[Any, Any, asyncio.Server]], handler: Callable[[ServerConnection], Coroutine[Any, Any, None]], logger: LoggerLike | None=…) -> None - changed:
function unix_serve(handler: Callable[[ServerConnection], Awaitable[None]], path: str | None=…, **kwargs: Any) -> Awaitable[Server] → function unix_serve(handler: Callable[[ServerConnection], Awaitable[None]], path: PathLike | None=…, **kwargs: Any) -> Server - added:
function serve(handler: Callable[[ServerConnection], Awaitable[None]], host: str | None=…, port: int | None=…, *, origins: Sequence[Origin | re.Pattern[str] | None] | None=…, extensions: Sequence[ServerExtensionFactory] | None=…, subprotocols: Sequence[Subprotocol] | None=…, select_subprotocol: Callable[[ServerConnection, Sequence[Subprotocol]], Subprotocol | None] | None=…, compression: str | No…
- added:
class HeaderLineTooLong(SecurityError) - added:
class InvalidMethod(InvalidHandshake) - added:
class InvalidProtocol(InvalidHandshake) - added:
class RequestLineTooLong(SecurityError) - added:
class StatusLineTooLong(SecurityError) - added:
class TooManyFragments(WebSocketException) - added:
class TooManyHeaders(SecurityError) - added:
constructor InvalidMethod(method: str) -> None - added:
constructor InvalidProtocol(protocol: str) -> None - added:
constructor TooManyFragments(max_fragments: int) -> None
- changed:
method PerMessageDeflate.decode(frame: frames.Frame, *, max_size: int | None=…) -> frames.Frame → method PerMessageDeflate.decode(frame: Frame, *, max_size: int | None=…) -> Frame - changed:
method PerMessageDeflate.encode(frame: frames.Frame) -> frames.Frame → method PerMessageDeflate.encode(frame: Frame) -> Frame
- removed:
variable CTRL_OPCODES - removed:
variable DATA_OPCODES - removed:
variable OP_BINARY - removed:
variable OP_CLOSE - removed:
variable OP_CONT - removed:
variable OP_PING - removed:
variable OP_PONG - removed:
variable OP_TEXT - changed:
static method Close.parse(data: BytesLike) -> Close → static method Close.parse(data: BytesLike) -> Self
- changed:
static method Request.parse(read_line: Callable[[int], Generator[None, None, bytes | bytearray]]) -> Generator[None, None, Request] → static method Request.parse(read_line: Callable[[int, type[Exception]], Generator[None, None, bytes | bytearray]]) -> Generator[None, None, Request] - changed:
static method Response.parse(read_line: Callable[[int], Generator[None, None, bytes | bytearray]], read_exact: Callable[[int], Generator[None, None, bytes | bytearray]], read_to_eof: Callable[[int], Generator[None, None, bytes | bytearray]], proxy: bool=…) -> Generator[None, None, Response] → static method Response.parse(read_line: Callable[[int, type[Exception]], Generator[None, None, bytes | bytearray]], read_exact: Callable[[int], Generator[None, None, bytes | bytearray]], read_to_eof: Callable[[int, type[Exception]], Generator[None, None, bytes | bytearray]], proxy: bool=…) -> Generator[None, None, Response] - added:
field Request.method: str - added:
field Request.protocol: str
- changed:
method StreamReader.read_line(m: int) -> Generator[None, None, bytearray] → method StreamReader.read_line(m: int, too_long_exc_type: type[Exception]=…) -> Generator[None, None, bytearray] - changed:
method StreamReader.read_to_eof(m: int) -> Generator[None, None, bytearray] → method StreamReader.read_to_eof(m: int, too_long_exc_type: type[Exception]=…) -> Generator[None, None, bytearray]
- changed:
constructor ClientConnection(socket: socket.socket, protocol: ClientProtocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None → constructor ClientConnection(sock: socket.socket, protocol: ClientProtocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None - changed:
function unix_connect(path: str | None=…, uri: str | None=…, **kwargs: Any) -> ClientConnection → function unix_connect(path: PathLike | None=…, uri: str | None=…, *, legacy: Literal[True] | None=…, **kwargs: Any) -> ClientConnection | (path: PathLike | None=…, uri: str | None=…, *, legacy: Literal[False], **kwargs: Any) -> reconnect - added:
class reconnect - added:
constructor reconnect(uri: str, *, sock: socket.socket | None=…, ssl: ssl_module.SSLContext | None=…, server_hostname: str | None=…, origin: Origin | None=…, extensions: Sequence[ClientExtensionFactory] | None=…, subprotocols: Sequence[Subprotocol] | None=…, compression: str | None=…, additional_headers: HeadersLike | None=…, user_agent_header: str | None=…, proxy: str | Literal[True] | None=…, p… - added:
function unix_reconnect(path: PathLike | None=…, uri: str | None=…, **kwargs: Any) -> reconnect - added:
method ClientConnection.maybe_raise_legacy_warning() -> None - added:
method reconnect.connect() -> ClientConnection - added:
method reconnect.enable_tls(sock: socket.socket, deadline: Deadline) -> socket.socket - added:
method reconnect.open_connection(deadline: Deadline) -> ClientConnection - added:
method reconnect.open_socket(deadline: Deadline) -> socket.socket - added:
method reconnect.process_redirect(exc: Exception) -> Exception | str
- removed:
method Connection.set_recv_exc(exc: BaseException | None) -> None - changed:
constructor Connection(socket: socket.socket, protocol: Protocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None → constructor Connection(sock: socket.socket, protocol: Protocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None - changed:
method Connection.ping(data: DataLike | None=…, ack_on_close: bool=…) -> threading.Event → method Connection.ping(data: DataLike | None=…, *, ack_on_close: bool=…) -> threading.Event - changed:
method Connection.send(message: DataLike | Iterable[DataLike], text: bool | None=…) -> None → method Connection.send(message: DataLike | Iterable[DataLike], *, text: bool | None=…) -> None - added:
method Connection.maybe_raise_legacy_warning() -> None - added:
method Connection.set_connection_exc(exc: BaseException | None) -> None - added:
method Connection.wait_closed(timeout: float | None=…) -> bool - added:
property Connection.close_exc -> ConnectionClosed
- changed:
function unix_route(url_map: Map, path: str | None=…, **kwargs: Any) -> Server → function unix_route(url_map: Map, path: PathLike | None=…, **kwargs: Any) -> Server
- changed:
constructor Server(socket: socket.socket, handler: Callable[[socket.socket, Any], None], logger: LoggerLike | None=…) -> None → constructor Server(sock: socket.socket, handler: Callable[[socket.socket, Any], None], logger: LoggerLike | None=…) -> None - changed:
constructor ServerConnection(socket: socket.socket, protocol: ServerProtocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None → constructor ServerConnection(sock: socket.socket, protocol: ServerProtocol, server: Server, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None - changed:
function unix_serve(handler: Callable[[ServerConnection], None], path: str | None=…, **kwargs: Any) -> Server → function unix_serve(handler: Callable[[ServerConnection], None], path: PathLike | None=…, **kwargs: Any) -> Server - changed:
method Server.shutdown() -> None → method Server.shutdown(close_connections: bool=…, code: CloseCode | int=…, reason: str=…) -> None - added:
export broadcast - added:
field Server.SHUTDOWN_POLLING_INTERVAL - added:
property Server.connections -> set[ServerConnection]
- added:
async method ClientConnection.handshake(additional_headers: HeadersLike | None=…, user_agent_header: str | None=…) -> None - added:
async method connect.connect(nursery: trio.Nursery) -> ClientConnection - added:
async method connect.enable_tls(stream: trio.abc.Stream) -> trio.abc.Stream - added:
async method connect.open_connection(nursery: trio.Nursery) -> ClientConnection - added:
async method connect.open_tcp_stream() -> trio.abc.Stream - added:
class ClientConnection(Connection) - added:
class connect - added:
constructor ClientConnection(nursery: trio.Nursery, stream: trio.abc.Stream, protocol: ClientProtocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None - added:
constructor connect(uri: str, *, stream: trio.abc.Stream | None=…, ssl: ssl_module.SSLContext | None=…, server_hostname: str | None=…, origin: Origin | None=…, extensions: Sequence[ClientExtensionFactory] | None=…, subprotocols: Sequence[Subprotocol] | None=…, compression: str | None=…, additional_headers: HeadersLike | None=…, user_agent_header: str | None=…, proxy: str | Literal[True] | None=…,… - added:
function unix_connect(path: PathLike | None=…, uri: str | None=…, **kwargs: Any) -> connect - added:
method ClientConnection.process_event(event: Event) -> None - added:
method connect.process_redirect(exc: Exception) -> Exception | str
- added:
async method Connection.aclose(code: CloseCode | int=…, reason: str=…) -> None - added:
async method Connection.close_stream() -> None - added:
async method Connection.keepalive() -> None - added:
async method Connection.ping(data: DataLike | None=…, *, ack_on_close: bool=…) -> trio.Event - added:
async method Connection.pong(data: DataLike=…) -> None - added:
async method Connection.recv(decode: Literal[True]) -> str | (decode: Literal[False]) -> bytes | (decode: bool | None=…) -> Data - added:
async method Connection.recv_events() -> None - added:
async method Connection.send(message: DataLike | Iterable[DataLike] | AsyncIterable[DataLike], *, text: bool | None=…) -> None - added:
async method Connection.send_context(*, expected_state: State=…) -> AsyncIterator[None] - added:
async method Connection.send_data() -> None - added:
async method Connection.wait_closed() -> None - added:
class Connection(trio.abc.AsyncResource) - added:
constructor Connection(nursery: trio.Nursery, stream: trio.abc.Stream, protocol: Protocol, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None - added:
method Connection.acknowledge_pending_pings() -> None - added:
method Connection.acknowledge_pings(data: bytes) -> None - added:
method Connection.pause_reading() -> None - added:
method Connection.process_event(event: Event) -> None - added:
method Connection.recv_streaming(decode: Literal[True]) -> AsyncIterator[str] | (decode: Literal[False]) -> AsyncIterator[bytes] | (decode: bool | None=…) -> AsyncIterator[Data] - added:
method Connection.resume_reading() -> None - added:
method Connection.set_connection_exc(exc: BaseException | None) -> None - added:
method Connection.start_keepalive() -> None - added:
property Connection.close_code -> int | None - added:
property Connection.close_exc -> ConnectionClosed - added:
property Connection.close_reason -> str | None - added:
property Connection.local_address -> Any - added:
property Connection.remote_address -> Any - added:
property Connection.state -> State - added:
property Connection.subprotocol -> Subprotocol | None
- added:
async method Assembler.get(decode: Literal[True]) -> str | (decode: Literal[False]) -> bytes | (decode: bool | None=…) -> Data - added:
class Assembler - added:
constructor Assembler(high: int | None=…, low: int | None=…, pause: Callable[[], Any]=…, resume: Callable[[], Any]=…) -> None - added:
method Assembler.close() -> None - added:
method Assembler.get_iter(decode: Literal[True]) -> AsyncIterator[str] | (decode: Literal[False]) -> AsyncIterator[bytes] | (decode: bool | None=…) -> AsyncIterator[Data] - added:
method Assembler.maybe_pause() -> None - added:
method Assembler.maybe_resume() -> None - added:
method Assembler.put(frame: Frame) -> None
- added:
async function route(url_map: Map, *args: Any, server_name: str | None=…, ssl: ssl_module.SSLContext | Literal[True] | None=…, create_router: type[Router] | None=…, task_status: trio.TaskStatus[Server]=…, **kwargs: Any) -> None - added:
async method Router.handler(connection: ServerConnection) -> None - added:
class Router - added:
constructor Router(url_map: Map, server_name: str | None=…, url_scheme: str=…) -> None - added:
method Router.get_server_name(connection: ServerConnection, request: Request) -> str - added:
method Router.not_found(connection: ServerConnection) -> Response - added:
method Router.redirect(connection: ServerConnection, url: str) -> Response - added:
method Router.route_request(connection: ServerConnection, request: Request) -> Response | None
- added:
async function serve(handler: Callable[[ServerConnection], Awaitable[None]], port: int | None=…, *, host: str | bytes | None=…, backlog: int | None=…, listeners: list[trio.SocketListener] | None=…, ssl: ssl_module.SSLContext | None=…, origins: Sequence[Origin | re.Pattern[str] | None] | None=…, extensions: Sequence[ServerExtensionFactory] | None=…, subprotocols: Sequence[Subprotocol] | None=…, se… - added:
async method Server.aclose(close_connections: bool=…, code: CloseCode | int=…, reason: str=…) -> None - added:
async method Server.serve_forever(task_status: trio.TaskStatus[Server]=…) -> None - added:
async method ServerConnection.handshake(process_request: Callable[[ServerConnection, Request], Awaitable[Response | None] | Response | None] | None=…, process_response: Callable[[ServerConnection, Request, Response], Awaitable[Response | None] | Response | None] | None=…, server_header: str | None=…) -> None - added:
class Server(trio.abc.AsyncResource) - added:
class ServerConnection(Connection) - added:
constructor Server(listeners: list[trio.SocketListener], handler: Callable[[trio.abc.Stream], Coroutine[Any, Any, None]], logger: LoggerLike | None=…) -> None - added:
constructor ServerConnection(nursery: trio.Nursery, stream: trio.abc.Stream, protocol: ServerProtocol, server: Server, *, ping_interval: float | None=…, ping_timeout: float | None=…, close_timeout: float | None=…, max_queue: int | None | tuple[int | None, int | None]=…) -> None - added:
export basic_auth - added:
export broadcast - added:
method ServerConnection.process_event(event: Event) -> None - added:
method ServerConnection.respond(status: StatusLike, text: str) -> Response - added:
property Server.connections -> set[ServerConnection]
- added:
async function race_events(*events: trio.Event) -> None
- added:
function get_socket_name(sock: socket.socket) -> str