From 7546aa606af3fcdcb9935d99068efc0742b8788d Mon Sep 17 00:00:00 2001 From: Virgil Dupras Date: Fri, 9 Jul 2010 21:46:19 -0700 Subject: [PATCH] Fixed an infinite loop in plat_other when using a relative path in a mounted directory. --HG-- branch : py3k extra : transplant_source : %B4%A2%DB%EFn%BB%3A%F6%AE%06%F3%29%DB%06%FBE%D0%A2%BEt --- 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 70959a5..657d4a3 100644 --- a/send2trash/plat_other.py +++ b/send2trash/plat_other.py @@ -33,8 +33,9 @@ EXTERNAL_CANDIDATES = [ 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 while not op.ismount(path): - path = op.join(*op.split(path)[:-1]) + path = op.split(path)[0] return path def find_ext_volume_trash(volume_root):