Illumos doesn't seem to mind self-sendfile but doesn't corrupt the file; make the test a little more forgiving. --- Python-3.14.0/Lib/test/test_shutil.py.orig +++ Python-3.14.0/Lib/test/test_shutil.py @@ -3192,8 +3192,13 @@ def test_same_file(self): self.addCleanup(self.reset) with self.get_files() as (src, dst): - with self.assertRaises((OSError, _GiveupOnFastCopy)): + try: self.zerocopy_fun(src, src) + except OSError: + pass + except _GiveupOn_FastCopy: + pass + # Make sure src file is not corrupted. self.assertEqual(read_file(TESTFN, binary=True), self.FILEDATA)