Skip to content

Commit 8640d64

Browse files
committed
fixed a usetex bug, running latex failed for files
with spaces in their path or their name. svn path=/trunk/matplotlib/; revision=2465
1 parent 6388a74 commit 8640d64

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

CHANGELOG

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,6 @@
1+
2006-06-11 Fixed a usetex bug for windows, running latex on files
2+
with spaces in their names or paths was failing - DSD
3+
14
2006-06-09 Made additions to numerix, changes to quiver to make it
25
work with all numeric flavors. - EF
36

lib/matplotlib/backends/backend_ps.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1271,7 +1271,7 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, paperWidth, paperHeight,
12711271
'\n'.join(psfrags), angle, os.path.split(epsfile)[-1])
12721272
latexh.close()
12731273

1274-
command = 'cd %s; latex -interaction=nonstopmode "%s"'%(gettempdir(), latexfile)
1274+
command = 'cd "%s"; latex -interaction=nonstopmode "%s"'%(gettempdir(), latexfile)
12751275
verbose.report(command, 'debug-annoying')
12761276
process = Popen([command], shell=True, stdin=PIPE, stdout=PIPE,
12771277
stderr=STDOUT)
@@ -1284,7 +1284,7 @@ def convert_psfrags(tmpfile, psfrags, font_preamble, paperWidth, paperHeight,
12841284
## verbose.report(stdout.read(), 'debug-annoying')
12851285
## verbose.report(stderr.read(), 'helpful')
12861286
## shutil.move(tmpfile, os.path.split(tmpfile)[-1])
1287-
command = 'cd %s; dvips -o "%s" "%s"' % (gettempdir(), psfile, dvifile)
1287+
command = 'cd "%s"; dvips -o "%s" "%s"' % (gettempdir(), psfile, dvifile)
12881288
verbose.report(command, 'debug-annoying')
12891289
process = Popen([command], shell=True, stdin=PIPE, stdout=PIPE,
12901290
stderr=STDOUT)

lib/matplotlib/texmanager.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -188,7 +188,7 @@ def make_dvi(self, tex, fontsize, force=0):
188188
if force or not os.path.exists(dvifile):
189189
tempdir = gettempdir()
190190
texbase = os.path.split(self.make_tex(tex, prefix, fontsize))[-1]
191-
command = 'cd %s; latex -interaction=nonstopmode "%s"'\
191+
command = 'cd "%s"; latex -interaction=nonstopmode "%s"'\
192192
%(tempdir, texbase)
193193
verbose.report(command, 'debug')
194194
process = Popen([command], shell=True, stdin=PIPE, stdout=PIPE,\

0 commit comments

Comments
 (0)