Skip to content

Commit ee336eb

Browse files
author
Bojan Nikolic
committed
GH-139416: Fix copyfile failure due to sendfile + Lustre
1 parent 872eafd commit ee336eb

File tree

1 file changed

+6
-0
lines changed

1 file changed

+6
-0
lines changed

Lib/shutil.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -213,6 +213,12 @@ def _fastcopy_sendfile(fsrc, fdst):
213213
_USE_CP_SENDFILE = False
214214
raise _GiveupOnFastCopy(err)
215215

216+
if err.errno == errno.ENODATA:
217+
# In rare cases sendfile() on Linux Lsture call
218+
# returns ENODATA.
219+
_USE_CP_SENDFILE = False
220+
raise _GiveupOnFastCopy(err)
221+
216222
if err.errno == errno.ENOSPC: # filesystem is full
217223
raise err from None
218224

0 commit comments

Comments
 (0)