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

@ -170,7 +170,7 @@ def normalize_mutagen(path):
md['mime'] = m.mime[0] if len(m.mime) > 0 else u''
md['path'] = normpath(path)
# silence detect(set default queue in and out)
# silence detect(set default cue in and out)
try:
command = ['silan', '-f', 'JSON', md['path']]
proc = subprocess.Popen(command, stdout=subprocess.PIPE)

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)