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

Adam Ehlers Nyholm Thomsen adament at adament.net
Tue Aug 26 08:48:34 EDT 2014


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')
-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 473 bytes
Desc: not available
URL: <http://four.pairlist.net/pipermail/scons-users/attachments/20140826/2480b3ea/attachment.pgp>


More information about the Scons-users mailing list