##// 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 import os
7 import os
8 import sys
8 import sys
9
9
10 from IPython.utils.process import find_cmd
10 from IPython.utils.traitlets import Integer, List, Bool, Instance
11 from IPython.utils.traitlets import Integer, List, Bool, Instance
11 from IPython.utils.tempdir import TemporaryWorkingDirectory
12 from IPython.utils.tempdir import TemporaryWorkingDirectory
12 from .latex import LatexExporter
13 from .latex import LatexExporter
@@ -57,13 +58,18 b' class PDFExporter(LatexExporter):'
57 or failed (False).
58 or failed (False).
58 """
59 """
59 command = [c.format(filename=filename) for c in command_list]
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 # unicode commands are not supported
63 # unicode commands are not supported
62 if sys.platform == 'win32' and sys.version_info < (3,0):
64 if sys.platform == 'win32' and sys.version_info < (3,0):
63 #We must use cp1252 encoding for calling subprocess.Popen
65 #We must use cp1252 encoding for calling subprocess.Popen
64 #Note that sys.stdin.encoding and encoding.DEFAULT_ENCODING
66 #Note that sys.stdin.encoding and encoding.DEFAULT_ENCODING
65 # could be different (cp437 in case of dos console)
67 # could be different (cp437 in case of dos console)
66 command = [c.encode('cp1252') for c in command]
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 times = 'time' if count == 1 else 'times'
73 times = 'time' if count == 1 else 'times'
68 self.log.info("Running %s %i %s: %s", command_list[0], count, times, command)
74 self.log.info("Running %s %i %s: %s", command_list[0], count, times, command)
69 with open(os.devnull, 'rb') as null:
75 with open(os.devnull, 'rb') as null:
General Comments 0
You need to be logged in to leave comments. Login now