[3.11] gh-114077: Fix OverflowError in socket.sendfile() when pass count >2GiB (GH-114079) (GH-114111)

(cherry picked from commit d4dfad2aa9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
This commit is contained in:
Miss Islington (bot) 2024-01-16 12:53:26 +01:00 committed by GitHub
parent f5cbed1114
commit 0e92265875
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
2 changed files with 3 additions and 1 deletions

View file

@ -381,7 +381,7 @@ class socket(_socket.socket):
if timeout and not selector_select(timeout):
raise TimeoutError('timed out')
if count:
blocksize = count - total_sent
blocksize = min(count - total_sent, blocksize)
if blocksize <= 0:
break
try: