diff options
author | Giampaolo Rodola <g.rodola@gmail.com> | 2019-05-30 14:05:41 +0800 |
---|---|---|
committer | GitHub <noreply@github.com> | 2019-05-30 14:05:41 +0800 |
commit | 413d955f8ec88a7183f91d7ad8b0ff7def803de3 (patch) | |
tree | 5e82b37895fa363bf445df67f61a56ff5553de61 /Lib/test/test_shutil.py | |
parent | a16387ab2d85f19665920bb6ff91a7e57f59dd2a (diff) | |
download | cpython-git-413d955f8ec88a7183f91d7ad8b0ff7def803de3.tar.gz |
bpo-36610: shutil.copyfile(): use sendfile() on Linux only (GH-13675)
...and avoid using it on Solaris as it can raise EINVAL if offset is equal or bigger than the size of the file
Diffstat (limited to 'Lib/test/test_shutil.py')
-rw-r--r-- | Lib/test/test_shutil.py | 6 |
1 files changed, 3 insertions, 3 deletions
diff --git a/Lib/test/test_shutil.py b/Lib/test/test_shutil.py index eeebb97ff6..208718bb12 100644 --- a/Lib/test/test_shutil.py +++ b/Lib/test/test_shutil.py @@ -2315,7 +2315,7 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase): # Emulate a case where sendfile() only support file->socket # fds. In such a case copyfile() is supposed to skip the # fast-copy attempt from then on. - assert shutil._HAS_SENDFILE + assert shutil._USE_CP_SENDFILE try: with unittest.mock.patch( self.PATCHPOINT, @@ -2324,13 +2324,13 @@ class TestZeroCopySendfile(_ZeroCopyFileTest, unittest.TestCase): with self.assertRaises(_GiveupOnFastCopy): shutil._fastcopy_sendfile(src, dst) assert m.called - assert not shutil._HAS_SENDFILE + assert not shutil._USE_CP_SENDFILE with unittest.mock.patch(self.PATCHPOINT) as m: shutil.copyfile(TESTFN, TESTFN2) assert not m.called finally: - shutil._HAS_SENDFILE = True + shutil._USE_CP_SENDFILE = True @unittest.skipIf(not MACOS, 'macOS only') |