add changelog for GH-2957
This commit is contained in:
parent
b570bf699c
commit
366f3f49af
3 changed files with 15 additions and 13 deletions
|
|
@ -511,9 +511,10 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
|||
compatibility with WSGI servers.
|
||||
|
||||
.. versionchanged:: 1.1
|
||||
Filenames may be a `PathLike` object.
|
||||
Filename may be a :class:`~os.PathLike` object.
|
||||
|
||||
.. versionadded:: 1.1
|
||||
Partial content supports ``BytesIO``.
|
||||
Partial content supports :class:`~io.BytesIO`.
|
||||
|
||||
:param filename_or_fp: the filename of the file to send.
|
||||
This is relative to the :attr:`~Flask.root_path`
|
||||
|
|
@ -606,6 +607,7 @@ def send_file(filename_or_fp, mimetype=None, as_attachment=False,
|
|||
try:
|
||||
fsize = file.getbuffer().nbytes
|
||||
except AttributeError:
|
||||
# Python 2 doesn't have getbuffer
|
||||
fsize = len(file.getvalue())
|
||||
headers['Content-Length'] = fsize
|
||||
data = wrap_file(request.environ, file)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue