]> 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:33:55 +0000 (10:33 +0000)
committerMarc-André Lemburg <mal@egenix.com>
Tue, 2 Sep 2008 10:33:55 +0000 (10:33 +0000)
Closes #3719.

Ported to 3.0 from r66145.

Lib/platform.py

index 27ea1b490fad6bfb32f73b91c086af9569261fa1..56ab759cfc07c3152ef3172477babd0a5627a6a8 100755 (executable)
@@ -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()