From e3761bd8d6b1d2fe53df1ed9c30106f45333daf9 Mon Sep 17 00:00:00 2001 From: Martin Konecny Date: Mon, 3 Dec 2012 16:33:24 -0500 Subject: [PATCH] -make sure lsof works for files with spaces --- python_apps/media-monitor2/media/monitor/pure.py | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/python_apps/media-monitor2/media/monitor/pure.py b/python_apps/media-monitor2/media/monitor/pure.py index a879f449f..8f1189bec 100644 --- a/python_apps/media-monitor2/media/monitor/pure.py +++ b/python_apps/media-monitor2/media/monitor/pure.py @@ -162,8 +162,7 @@ def walk_supported(directory, clean_empties=False): def file_locked(path): - cmd = "lsof %s" % path - f = Popen(cmd, shell=True, stdout=PIPE).stdout + f = Popen(["lsof", path], stdout=PIPE).stdout return bool(f.readlines()) def magic_move(old, new, after_dir_make=lambda : None):