From 45eb69f8bac0e4905c8f511a86b8c6705d33ff74 Mon Sep 17 00:00:00 2001 From: Pouria-yvr <75648294+Pouria-yvr@users.noreply.github.com> Date: Tue, 5 Aug 2025 17:31:06 -0700 Subject: [PATCH] Update helpers.pyLoosen send_file type annotation to include t.IO[bytes] Include typing.IO[bytes] to align with Werkzeug and resolve issue #5776. --- src/flask/helpers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/flask/helpers.py b/src/flask/helpers.py index 90a0e0c6..44aa81c9 100644 --- a/src/flask/helpers.py +++ b/src/flask/helpers.py @@ -398,7 +398,7 @@ def _prepare_send_file_kwargs(**kwargs: t.Any) -> dict[str, t.Any]: def send_file( - path_or_file: os.PathLike[t.AnyStr] | str | t.BinaryIO, + path_or_file: os.PathLike[t.AnyStr] | str | t.BinaryIO | t.IO[bytes], mimetype: str | None = None, as_attachment: bool = False, download_name: str | None = None,