diff --git a/Lib/pathlib.py b/Lib/pathlib.py index 851aabd479725f..515052f9e6af5c 100644 --- a/Lib/pathlib.py +++ b/Lib/pathlib.py @@ -1116,7 +1116,7 @@ def samefile(self, other_path): try: other_st = other_path.stat() except AttributeError: - other_st = os.stat(other_path) + other_st = self._accessor.stat(other_path) return os.path.samestat(st, other_st) def iterdir(self):