> Are you this only happens when there is an error?
Yes, when an error occurs while configuring, no matter for what reason, configure.py quits and
creates empty textclass.lst and packages.lst. The files are empty because at the beginning of
configure.py they are created when they don't already exist, when they already exist, they will be
cleaned. So when an error occurs, the script stops and we have empty files.
So a first step to fix this bug is to create/refresh the files direcly at this point in the script
where the lists are created and not always at the beginning.
> Because if I read the thread correctly there was a case where no output was
sent.
This was a bug in MiKTeX, that is now fixed since a while.
> As you guess it is quite easy to catch an exception in python. My problem with
> this scheme is that probably we are implementing a blanket that will hide all
> the errors.
We don't hide anything: Currently configure.py quits on errors showing you the position where it
fails. Fine, but it leaves empty files. I mean that we should handle all possible errors as
exception and in this case create minimal files, that are always working. The error position is
shown nevertheless, so no difference to the current implementation.
configure.py would then look like this (in pseudo code):
begin script
do something
try
if textclasss.lst not exists
create textclass.lst
else
clear textclass.lst
create package list and write it to textclass.lst
do something
finally
check if textclass.lst is a valid file (readable by LyX)
case yes
do nothing
case no
create minimal list as textclass.lst
end finally
end script
The try finally block assures that the oputput .lst files are LyX readable and
the problem has gone.
An alternative and perhaps better design would be:
begin script
do something
try
if textclasss.lst not exists
create textclass.lst
else
clear textclass.lst
except
write "textclass.lst could not be created/modified,
perhaps a file permission problem"
end except
try
create package list and write it to textclass.lst
except
create minimal list as textclass.lst
end except
do something
end script
The important thing is to start the try block before we create or clear the .lst files, because also
in these routines errors can occur.
regards Uwe