From 1126e3dfd8b5bae4d7c96093858c508bac93edef Mon Sep 17 00:00:00 2001 From: Enrico Forestieri Date: Sun, 28 Aug 2011 22:57:58 +0000 Subject: [PATCH] Fix bug #7718 (Configure fails if shell autorun commands are enabled in the registry) git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@39554 a592a061-630c-0410-9148-cb99ea01b6c8 --- lib/configure.py | 18 ++++++++++++++---- 1 file changed, 14 insertions(+), 4 deletions(-) diff --git a/lib/configure.py b/lib/configure.py index add430ccfc..16c7e4c4cd 100644 --- a/lib/configure.py +++ b/lib/configure.py @@ -60,7 +60,12 @@ def cmdOutput(cmd): '''utility function: run a command and get its output as a string cmd: command to run ''' - pipe = subprocess.Popen(cmd, shell=True, stdin=subprocess.PIPE, \ + if os.name == 'nt': + b = False + cmd = 'cmd /d /c ' + cmd + else: + b = True + pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \ stdout=subprocess.PIPE, universal_newlines=True) pipe.stdin.close() output = pipe.stdout.read() @@ -1106,9 +1111,14 @@ def checkLatexConfig(check_config, bool_docbook): cl.close() # # we have chklayouts.tex, then process it - pipe = subprocess.Popen([LATEX, "wrap_chkconfig.ltx"], \ - stdin=subprocess.PIPE, stdout=subprocess.PIPE, \ - universal_newlines=True) + cmd = LATEX + ' wrap_chkconfig.ltx' + if os.name == 'nt': + b = False + cmd = 'cmd /d /c ' + cmd + else: + b = True + pipe = subprocess.Popen(cmd, shell=b, close_fds=b, stdin=subprocess.PIPE, \ + stdout=subprocess.PIPE, universal_newlines=True) pipe.stdin.close() while True: line = pipe.stdout.readline() -- 2.39.2