undo - make sure path names are quoted when passing to lsof
This commit is contained in:
parent
deb50ea769
commit
e35416b1e8
2 changed files with 3 additions and 2 deletions
|
@ -170,7 +170,7 @@ def normalize_mutagen(path):
|
||||||
md['mime'] = m.mime[0] if len(m.mime) > 0 else u''
|
md['mime'] = m.mime[0] if len(m.mime) > 0 else u''
|
||||||
md['path'] = normpath(path)
|
md['path'] = normpath(path)
|
||||||
|
|
||||||
# silence detect(set default queue in and out)
|
# silence detect(set default cue in and out)
|
||||||
try:
|
try:
|
||||||
command = ['silan', '-f', 'JSON', md['path']]
|
command = ['silan', '-f', 'JSON', md['path']]
|
||||||
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
proc = subprocess.Popen(command, stdout=subprocess.PIPE)
|
||||||
|
|
|
@ -166,7 +166,8 @@ def walk_supported(directory, clean_empties=False):
|
||||||
|
|
||||||
|
|
||||||
def file_locked(path):
|
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')
|
out = proc.communicate()[0].strip('\r\n')
|
||||||
return bool(out)
|
return bool(out)
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue