Add quotes around the file name to avoid issues with spaces.
Closes #3719.
This commit is contained in:
parent
91ae3ea2b4
commit
d15fad7a89
|
@ -969,7 +969,7 @@ def _syscmd_file(target,default=''):
|
||||||
return default
|
return default
|
||||||
target = _follow_symlinks(target)
|
target = _follow_symlinks(target)
|
||||||
try:
|
try:
|
||||||
f = os.popen('file %s 2> /dev/null' % target)
|
f = os.popen('file "%s" 2> /dev/null' % target)
|
||||||
except (AttributeError,os.error):
|
except (AttributeError,os.error):
|
||||||
return default
|
return default
|
||||||
output = string.strip(f.read())
|
output = string.strip(f.read())
|
||||||
|
|
Loading…
Reference in New Issue