use IO[bytes] instead of BinaryIO for wider compatibility (#5777)

This commit is contained in:
David Lord 2025-08-18 10:26:12 -07:00 committed by GitHub
commit 1dfd7cd555
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
2 changed files with 2 additions and 1 deletions

View file

@ -5,6 +5,7 @@ Unreleased
- When using ``follow_redirects`` in the test client, the final state
of ``session`` is correct. :issue:`5786`
- Relax type hint for passing bytes IO to ``send_file``. :issue:`5776`
Version 3.1.1

View file

@ -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.IO[bytes],
mimetype: str | None = None,
as_attachment: bool = False,
download_name: str | None = None,