mirror of
https://github.com/python/cpython.git
synced 2024-11-25 10:54:51 +08:00
gh-82500: Fix asyncio sendfile overflow on 32bit (#107056)
This commit is contained in:
parent
7fc9be350a
commit
9eeb4b485f
@ -394,6 +394,9 @@ class _UnixSelectorEventLoop(selector_events.BaseSelectorEventLoop):
|
||||
fut.set_result(total_sent)
|
||||
return
|
||||
|
||||
# On 32-bit architectures truncate to 1GiB to avoid OverflowError
|
||||
blocksize = min(blocksize, sys.maxsize//2 + 1)
|
||||
|
||||
try:
|
||||
sent = os.sendfile(fd, fileno, offset, blocksize)
|
||||
except (BlockingIOError, InterruptedError):
|
||||
|
@ -0,0 +1 @@
|
||||
Fix overflow on 32-bit systems with :mod:`asyncio` :func:`os.sendfile` implemention.
|
Loading…
Reference in New Issue
Block a user