File tree Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Expand file tree Collapse file tree 1 file changed +8
-5
lines changed Original file line number Diff line number Diff line change @@ -206,13 +206,16 @@ def _fastcopy_sendfile(fsrc, fdst):
206
206
err .filename = fsrc .name
207
207
err .filename2 = fdst .name
208
208
209
- if err .errno in ( errno .ENOTSOCK , errno . ENODATA ) :
209
+ if err .errno == errno .ENOTSOCK :
210
210
# ENOTSOCK: sendfile() on this platform (probably
211
211
# Linux < 2.6.33) does not support copies between
212
212
# regular files (only sockets).
213
- #
214
- # ENODATA: In rare cases, sendfile() on Linux Lustre
215
- # returns ENODATA.
213
+ _USE_CP_SENDFILE = False
214
+ raise _GiveupOnFastCopy (err )
215
+
216
+ if err .errno == errno .ENODATA :
217
+ # In rare cases, sendfile() on Linux Lustre returns
218
+ # ENODATA.
216
219
_USE_CP_SENDFILE = False
217
220
218
221
dstpos = os .lseek (outfd , 0 , os .SEEK_CUR )
@@ -224,7 +227,7 @@ def _fastcopy_sendfile(fsrc, fdst):
224
227
# back on POSIX read/write method
225
228
os .lseek (infd , dstpos , os .SEEK_SET )
226
229
227
- raise _GiveupOnFastCopy (err )
230
+ raise _GiveupOnFastCopy (err )
228
231
229
232
if err .errno == errno .ENOSPC : # filesystem is full
230
233
raise err from None
You can’t perform that action at this time.
0 commit comments