Add quotes around the file name to avoid issues with spaces.

Closes #3719.

Ported to 3.0 from r66145.
This commit is contained in:
Marc-André Lemburg 2008-09-02 10:33:55 +00:00
parent 54bd41d81b
commit 407798595d

View file

@ -945,7 +945,7 @@ def _syscmd_file(target,default=''):
return default
target = _follow_symlinks(target)
try:
f = os.popen('file %s 2> /dev/null' % target)
f = os.popen('file "%s" 2> /dev/null' % target)
except (AttributeError,os.error):
return default
output = f.read().strip()