quart.utils module#

exception quart.utils.MustReloadError#

Bases: Exception

async quart.utils.cancel_tasks(tasks: set[Task]) None#
quart.utils.decode_headers(headers: Iterable[tuple[bytes, bytes]]) Headers#
quart.utils.encode_headers(headers: Headers) list[tuple[bytes, bytes]]#
quart.utils.file_path_to_path(*paths: bytes | str | PathLike) Path#
async quart.utils.observe_changes(sleep: Callable[[float], Awaitable[Any]], shutdown_event: Event) None#
quart.utils.raise_task_exceptions(tasks: set[Task]) None#
quart.utils.restart() None#
quart.utils.run_sync(func: Callable[[...], Any]) Callable[[...], Coroutine[None, None, Any]]#

Ensure that the sync function is run within the event loop.

If the func is not a coroutine it will be wrapped such that it runs in the default executor (use loop.set_default_executor to change). This ensures that synchronous functions do not block the event loop.

quart.utils.run_sync_iterable(iterable: Generator[Any, None, None]) AsyncGenerator[Any, None]#