From d090156c452dff798a97056d65dcc48a95190554 Mon Sep 17 00:00:00 2001 From: gbn Date: Sun, 13 Mar 2011 14:38:03 -0400 Subject: [PATCH] Use realpath to find mountpoint --- send2trash/plat_other.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/send2trash/plat_other.py b/send2trash/plat_other.py index 867de92..637b359 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -81,7 +81,8 @@ def trash_move(src, dst, topdir=None): def find_mount_point(path): # Even if something's wrong, "/" is a mount point, so the loop will exit. - path = op.abspath(path) # Required to avoid infinite loop + # Use realpath in case it's a symlink + path = op.realpath(path) # Required to avoid infinite loop while not op.ismount(path): path = op.split(path)[0] return path