On Sat, Aug 27, 2011 at 01:29:37AM +0200, jri...@lyx.org wrote: > Author: jrioux > Date: Sat Aug 27 01:29:37 2011 > New Revision: 39533 > URL: http://www.lyx.org/trac/changeset/39533 > > Log: > configure.py : subprocess, second try (check_output requires > python 2.7 and throws unwanted exceptions when the process > return value is not 0
subprocess.Popen() also increases the requirement on python. In README we have the following: Python 2.3 or later to convert old LyX files and for helper scripts. Note 1: Python 2.3.4 or later is required for exporting LyX files to a pre-unicode format, as previous versions are affected by a bug about the normalization of unicode strings. Note 2: Python 2.4.0 or later is required for the clean_dvi.py script, which, however, is only used on Windows, where at least Python 2.6.0 is anyway recommended. Note 3: Python 3.0 or later is not supported. so, you may want to also update that, and next time maybe discuss such changes before committing... > Modified: > lyx-devel/trunk/lib/configure.py > > Modified: lyx-devel/trunk/lib/configure.py > ============================================================================== > --- lyx-devel/trunk/lib/configure.py Sat Aug 27 01:13:34 2011 (r39532) > +++ lyx-devel/trunk/lib/configure.py Sat Aug 27 01:29:37 2011 (r39533) > @@ -60,7 +60,9 @@ > '''utility function: run a command and get its output as a string > cmd: command to run > ''' > - output = subprocess.check_output(cmd, shell=True) > + fout = subprocess.Popen(cmd, shell=True, stdout=subprocess.PIPE).stdout > + output = fout.read() > + fout.close() > return output.strip() > > > @@ -640,9 +642,14 @@ > checkProg('a Sweave -> R/S code converter', ['Rscript --verbose > --no-save --no-restore $$s/scripts/lyxstangle.R $$i $$e $$r'], > rc_entry = [ r'\converter sweave r "%%" ""' ]) > # > - checkProg('an HTML -> LaTeX converter', ['html2latex $$i', > 'gnuhtml2latex $$i', \ > - 'htmltolatex -input $$i -output $$o', 'java -jar htmltolatex.jar > -input $$i -output $$o'], > - rc_entry = [ r'\converter html latex "%%" ""' ]) > + path, htmltolatex = checkProg('an HTML -> LaTeX converter', ['html2latex > $$i', > + 'gnuhtml2latex $$i', 'htmltolatex -input $$i -output $$o', > 'htmltolatex.jar'], > + rc_entry = [ r'\converter html latex "%%" ""', > + r'\converter html latex "%%" ""', > + r'\converter html latex "%%" ""', '', ''] ) > + if htmltolatex == 'htmltolatex.jar': > + addToRC(r'\converter html latex "java -jar %s -input $$i > -output $$o" ""' > + % os.path.join(path, htmltolatex)) > # > checkProg('an MS Word -> LaTeX converter', ['wvCleanLatex $$i $$o'], > rc_entry = [ r'\converter word latex "%%" ""' ]) -- Enrico