summaryrefslogtreecommitdiffstats
path: root/Lib/asyncio
diff options
context:
space:
mode:
authorYury Selivanov <yury@magic.io>2018-01-27 20:52:52 (GMT)
committerGitHub <noreply@github.com>2018-01-27 20:52:52 (GMT)
commitb1a6ac4c4026d648b3d948945b734a4d0f175a3c (patch)
tree6abf3b571d36187177b3dbae470f59a6f768a52a /Lib/asyncio
parent7c684073f951dd891021676ecfd86ffc18b8895e (diff)
downloadcpython-b1a6ac4c4026d648b3d948945b734a4d0f175a3c.zip
cpython-b1a6ac4c4026d648b3d948945b734a4d0f175a3c.tar.gz
cpython-b1a6ac4c4026d648b3d948945b734a4d0f175a3c.tar.bz2
bpo-32622: Enforce sendfile fallback policy for FALLBACK transports (#5364)
Diffstat (limited to 'Lib/asyncio')
-rw-r--r--Lib/asyncio/base_events.py7
1 files changed, 6 insertions, 1 deletions
diff --git a/Lib/asyncio/base_events.py b/Lib/asyncio/base_events.py
index f532dc4..7442bf2 100644
--- a/Lib/asyncio/base_events.py
+++ b/Lib/asyncio/base_events.py
@@ -1035,7 +1035,12 @@ class BaseEventLoop(events.AbstractEventLoop):
except events.SendfileNotAvailableError as exc:
if not fallback:
raise
- # the mode is FALLBACK or fallback is True
+
+ if not fallback:
+ raise RuntimeError(
+ f"fallback is disabled and native sendfile is not "
+ f"supported for transport {transport!r}")
+
return await self._sendfile_fallback(transport, file,
offset, count)