]> granicus.if.org Git - python/commitdiff
Add quotes around the file name to avoid issues with spaces.
authorMarc-André Lemburg <mal@egenix.com>
Tue, 2 Sep 2008 10:32:34 +0000 (10:32 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Tue, 2 Sep 2008 10:32:34 +0000 (10:32 +0000)
Closes #3719.

Lib/platform.py

index 73b6fdb67639c4e938a194ef34962420b6733b75..cc0431bc56c0e63939a46016b8962fa10038343c 100755 (executable)
@@ -969,7 +969,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 = string.strip(f.read())