You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Send a 0 byte file with aiohttp.web.FileResponse on python 3.7 or later
💡 Expected behavior
No exception
📋 Logs/tracebacks
Traceback (most recent call last):
File "/__w/core/core/venv/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 461, in start
resp, reset =await task
File "/__w/core/core/venv/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 414, in _handle_request
reset =awaitself.finish_response(request, resp, start_time)
File "/__w/core/core/venv/lib/python3.7/site-packages/aiohttp/web_protocol.py", line 568, in finish_responseawait prepare_meth(request)
File "/__w/core/core/venv/lib/python3.7/site-packages/aiohttp/web_fileresponse.py", line 373, in preparereturnawaitself._sendfile(request, fobj, offset, count)
File "/__w/core/core/venv/lib/python3.7/site-packages/aiohttp/web_fileresponse.py", line 191, in _sendfile_systemawait writer.sendfile()
File "/__w/core/core/venv/lib/python3.7/site-packages/aiohttp/web_fileresponse.py", line 107, in sendfileself._count
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 1044, in sendfile
offset, count)
File "/usr/local/lib/python3.7/asyncio/selector_events.py", line 551, in _sendfile_native
fallback=False)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 788, in sock_sendfileself._check_sendfile_params(sock, file, offset, count)
File "/usr/local/lib/python3.7/asyncio/base_events.py", line 842, in _check_sendfile_params"count must be a positive integer (got {!r})".format(count))
ValueError: count must be a positive integer (got 0)
📋 Your version of the Python
$ python --versionPython 3.8.1...
📋 Your version of the aiohttp/yarl/multidict distributions
$ python -m pip show aiohttp...
$ python -m pip show multidict...
$ python -m pip show yarl...
📋 Additional context
The text was updated successfully, but these errors were encountered:
🐞 Describe the bug
#4517 caused a regression with 0 byte files.
💡 To Reproduce
Send a 0 byte file with
aiohttp.web.FileResponse
on python 3.7 or later💡 Expected behavior
No exception
📋 Logs/tracebacks
📋 Your version of the Python
📋 Your version of the aiohttp/yarl/multidict distributions
📋 Additional context
The text was updated successfully, but these errors were encountered: