Skip to content

Commit 3618b95

Browse files
committed
gh-142403: Avoid leaking file descriptor in socket.py
1 parent 3db7bf2 commit 3618b95

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

Lib/socket.py

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -416,6 +416,7 @@ def _sendfile_zerocopy(self, zerocopy_func, giveup_exc_type, file,
416416
total_sent += sent
417417
return total_sent
418418
finally:
419+
selector.close()
419420
if total_sent > 0 and hasattr(file, 'seek'):
420421
file.seek(offset)
421422

0 commit comments

Comments
 (0)