From 4a17901c1d28fb3b7cc91a941915c45d335b654e Mon Sep 17 00:00:00 2001 From: Stefano Rivera Date: Sun, 23 Nov 2025 13:50:57 -0400 Subject: [PATCH] reflink() doesn't take Path parameters Fix `test_successful_reflink`, by passing the right kinds of parameters. This was failing inside the reflink package: ``` /usr/lib/python3/dist-packages/reflink/reflink.py:34: in reflink backend.clone(oldpath, newpath) _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ oldpath = PosixPath('/tmp/tmpx3jirmhp/testfile') newpath = PosixPath('/tmp/tmpx3jirmhp/testfile.dest') def clone(oldpath, newpath): if isinstance(oldpath, unicode): oldpath = oldpath.encode(sys.getfilesystemencoding()) if isinstance(newpath, unicode): newpath = newpath.encode(sys.getfilesystemencoding()) > newpath_c = ffi.new('char[]', newpath) ^^^^^^^^^^^^^^^^^^^^^^^^^^ E TypeError: expected new array length or list/tuple/str, not PosixPath ``` --- test/test_files.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/test/test_files.py b/test/test_files.py index 631b56b72..d0d93987c 100644 --- a/test/test_files.py +++ b/test/test_files.py @@ -579,7 +579,7 @@ class SafeMoveCopyTest(FilePathTestCase): @NEEDS_REFLINK def test_successful_reflink(self): - util.reflink(self.path, self.dest) + util.reflink(str(self.path), str(self.dest)) assert self.dest.exists() assert self.path.exists()