[scribus] Crashing script

Gregory Pittman gpittman at iglou.com
Thu Jan 22 15:55:58 CET 2009

mental at mentalware.com wrote:
> ----------------------------------
> Here's what I see whtn the program crashes after having written the
> first PDF file and starts back thru on the second.
> Traceback (most recent call last):
>   File "", line 8, in
>   File "/home/me/workspace/test.py", line 80, in
>     main_wrapper(sys.argv)
>   File "/home/me/workspace/test.py", line 68, in main_wrapper
>     main(argv)
>   File "/home/me/workspace/test.py", line 32, in main
>     infile = os.path.join(work_path,fn)
>   File "/usr/lib/python2.5/posixpath.py", line 59, in join
>     for b in p:
> IndexError: list assignment index out of range
> Any help or ideas would be greatly appreciated.

I've done a fair amount of script writing, though I admit my coding 
style is a bit more ad hoc. The traceback, aside from the fact that 
deleting scribus-related commands seems to "fix" it, suggests the 
problem is in the non-scribus code.
You have a lot of complexity in your lines, especially those involved 
with the file identification and selection. This is common and somewhat 
encouraged in Perl, but my sense is that it is not favored or advised in 
Python (and makes it difficult for me to sort this out), and I think you 
might do well to break this down into discrete instances, then once you 
have this working, then go on to reading directories and generating 
lists, and so on.

Another thing to try is to write a Python script that contains no 
scribus references at all, so that it can run outside of scribus, and 
you can as needed stick in some debugging messages to help you see what 
values get generated as the script runs. Once you have the os and sys 
aspects of the script working, then go back to a scribus-specific one 
and work out the scribus commands, and again, I would initially generate 
discrete instances of the use of the scribus commands, then generalize.


More information about the scribus mailing list