undo - make sure path names are quoted when passing to lsof

This commit is contained in:
Martin Konecny 2013-02-25 17:43:02 -05:00
parent deb50ea769
commit e35416b1e8
2 changed files with 3 additions and 2 deletions

View file

@ -166,7 +166,8 @@ def walk_supported(directory, clean_empties=False):
def file_locked(path):
proc = Popen(["lsof", '"%s"' % path], stdout=PIPE)
#Capture stderr to avoid polluting py-interpreter.log
proc = Popen(["lsof", path], stdout=PIPE, stderr=PIPE)
out = proc.communicate()[0].strip('\r\n')
return bool(out)