[Scons-users] LaTeX: Fails on \input with non-existing file

Managan, Rob managan1 at llnl.gov
Tue Aug 26 11:35:32 EDT 2014


Hi Adam,

Thanks for pointing this out. The fix is simple and I will get it in.

Rob Managan
________________________________________
From: Scons-users [scons-users-bounces at scons.org] on behalf of Adam Ehlers Nyholm Thomsen [adament at adament.net]
Sent: Tuesday, August 26, 2014 5:48 AM
To: scons-users at scons.org
Subject: [Scons-users] LaTeX: Fails on \input with non-existing file

Dear Scons mailing list,

When compiling a LaTeX document which includes an
\input{non-existing.tex} but such that "non-existing.tex" doesn't exist
SCons throws an exception:

scons: Reading SConscript files ...
scons: done reading SConscript files.
scons: Building targets ...
scons: *** [test.pdf] UnboundLocalError : local variable 'file_test' referenced before assignment
Traceback (most recent call last):
  File "/usr/lib/python2.7/site-packages/SCons/Action.py", line 1065, in execute
    result = self.execfunction(target=target, source=rsources, env=env)
  File "/usr/lib/python2.7/site-packages/SCons/Tool/pdftex.py", line 59, in PDFTeXLaTeXFunction
    if SCons.Tool.tex.is_LaTeX(source,env,abspath):
  File "/usr/lib/python2.7/site-packages/SCons/Tool/tex.py", line 554, in is_LaTeX
    if file_test:
UnboundLocalError: local variable 'file_test' referenced before assignment
scons: building terminated because of errors.

I would personally prefer a more informative error message.

Sincerely,
Adam

A (sort of) minimal example:
*** test.tex ***
% vim:ts=3:sw=3:noexpandtab
\input{preamble.tex}

\begin{document}
\title{The uncountability of SCons features}
\author{Adam Ehlers Nyholm Thomsen}
\maketitle

\end{document}

*** SConstruct ***
env = Environment(tools = ['pdflatex', 'pdftex'])

env.PDF('test.tex')


More information about the Scons-users mailing list