mirror of
https://github.com/python/cpython.git
synced 2025-12-08 06:10:17 +00:00
gh-142403: Avoid leaking file descriptor in socket.py
This commit is contained in:
parent
3db7bf2d18
commit
3618b9567a
1 changed files with 1 additions and 0 deletions
|
|
@ -416,6 +416,7 @@ def _sendfile_zerocopy(self, zerocopy_func, giveup_exc_type, file,
|
||||||
total_sent += sent
|
total_sent += sent
|
||||||
return total_sent
|
return total_sent
|
||||||
finally:
|
finally:
|
||||||
|
selector.close()
|
||||||
if total_sent > 0 and hasattr(file, 'seek'):
|
if total_sent > 0 and hasattr(file, 'seek'):
|
||||||
file.seek(offset)
|
file.seek(offset)
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue