[Python-checkins] bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (GH-18836)

Barney Gale webhook-mailer at python.org
Fri Apr 17 13:47:32 EDT 2020


https://github.com/python/cpython/commit/5b1d9184bb0e34391637c06bc7651fb6de8a6240
commit: 5b1d9184bb0e34391637c06bc7651fb6de8a6240
branch: master
author: Barney Gale <barney.gale at gmail.com>
committer: GitHub <noreply at github.com>
date: 2020-04-17T19:47:27+02:00
summary:

bpo-39894: Route calls from pathlib.Path.samefile() to os.stat() via the path accessor (GH-18836)

files:
M Lib/pathlib.py

diff --git a/Lib/pathlib.py b/Lib/pathlib.py
index d3e89dfbc88ac..88ebe030c7ff7 100644
--- a/Lib/pathlib.py
+++ b/Lib/pathlib.py
@@ -1131,7 +1131,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):



More information about the Python-checkins mailing list