]> granicus.if.org Git - python/commitdiff
#5551: symbolic links never can be mount points. Fixes the fix for #1713.
authorGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 15:30:56 +0000 (15:30 +0000)
committerGeorg Brandl <georg@python.org>
Sun, 1 Aug 2010 15:30:56 +0000 (15:30 +0000)
Lib/posixpath.py
Misc/NEWS

index 667f5c52de2e1b47743962eb018b06b06dd9291e..e9f4251846cf0d1bfe15bf9c0ccea26e903f071d 100644 (file)
@@ -200,6 +200,9 @@ def samestat(s1, s2):
 
 def ismount(path):
     """Test whether a path is a mount point"""
+    if islink(path):
+        # A symlink can never be a mount point
+        return False
     try:
         s1 = os.lstat(path)
         if isinstance(path, bytes):
index 0fa78458f52b04645d28bcb53fe4c1ed5274fd7f..94bf2b9de072223aa92126c1e684776bad5c9587 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -29,6 +29,9 @@ Extensions
 Library
 -------
 
+- Issue #1713: Fix os.path.ismount(), which returned true for symbolic links
+  across devices.
+
 - Issue #8826: Properly load old-style "expires" attribute in http.cookies.
 
 - Issue #1690103: Fix initial namespace for code run with trace.main().