From: Marc-André Lemburg Date: Tue, 2 Sep 2008 10:33:55 +0000 (+0000) Subject: Add quotes around the file name to avoid issues with spaces. X-Git-Tag: v3.0rc1~132 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=407798595dab4698a86eac4db529cd94b586331e;p=python Add quotes around the file name to avoid issues with spaces. Closes #3719. Ported to 3.0 from r66145. --- diff --git a/Lib/platform.py b/Lib/platform.py index 27ea1b490f..56ab759cfc 100755 --- a/Lib/platform.py +++ b/Lib/platform.py @@ -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()