##// END OF EJS Templates
Merge pull request #7453 from takluyver/check-latex-commands...
Min RK -
r19925:dd150e70 merge
parent child Browse files
Show More
@@ -7,6 +7,7 b' import subprocess'
7 7 import os
8 8 import sys
9 9
10 from IPython.utils.process import find_cmd
10 11 from IPython.utils.traitlets import Integer, List, Bool, Instance
11 12 from IPython.utils.tempdir import TemporaryWorkingDirectory
12 13 from .latex import LatexExporter
@@ -57,13 +58,18 b' class PDFExporter(LatexExporter):'
57 58 or failed (False).
58 59 """
59 60 command = [c.format(filename=filename) for c in command_list]
60 #In windows and python 2.x there is a bug in subprocess.Popen and
61
62 # On windows with python 2.x there is a bug in subprocess.Popen and
61 63 # unicode commands are not supported
62 64 if sys.platform == 'win32' and sys.version_info < (3,0):
63 65 #We must use cp1252 encoding for calling subprocess.Popen
64 66 #Note that sys.stdin.encoding and encoding.DEFAULT_ENCODING
65 67 # could be different (cp437 in case of dos console)
66 68 command = [c.encode('cp1252') for c in command]
69
70 # This will throw a clearer error if the command is not found
71 find_cmd(command_list[0])
72
67 73 times = 'time' if count == 1 else 'times'
68 74 self.log.info("Running %s %i %s: %s", command_list[0], count, times, command)
69 75 with open(os.devnull, 'rb') as null:
General Comments 0
You need to be logged in to leave comments. Login now