Custom scripts stopped working

I’m not sure what happened. But all of a sudden all my custom scripts started throwing the following error when they are run:

2013-10-07 16:22:45: Main Window shown
2013-10-07 16:22:53: Traceback (most recent call last):
2013-10-07 16:22:53: File “DeadlineUI\UI\Commands\ScriptCommands.py”, line 80, in InnerExecute
2013-10-07 16:22:53: Exception: Python Exception: SyntaxError : (Python.Runtime.PythonException)
2013-10-07 16:22:53: Type: <type ‘exceptions.SyntaxError’>
2013-10-07 16:22:53: Value: (‘invalid syntax’, (‘none’, 19, 4, ’ '))
2013-10-07 16:22:53: Stack Trace:
2013-10-07 16:22:53:
2013-10-07 16:22:53:
2013-10-07 16:22:53: at FranticX.Scripting.PythonNetScriptEngine.a(Exception A_0)
2013-10-07 16:22:53: at FranticX.Scripting.PythonNetScriptEngine.ExecuteScript(String scriptName, String script)
2013-10-07 16:22:53: at Deadline.Scripting.DeadlineScriptManager.CreateScopeFromScript(String scopeName, String scriptName, String script, Boolean addGlobalFunctions, Boolean redirectToScriptManagerListener)
2013-10-07 16:22:53: at Deadline.Scripting.DeadlineScriptManager.CreateScopeFromScript(String scopeName, String scriptName, String script, Boolean addGlobalFunctions)

I created this basic test script and put it here\renderfarm\DeadlineRepository6\custom\scripts\Jobs

[b]import clr
import sys

from System.IO import *

from Deadline.Scripting import *

from DeadlineUI.Controls.Scripting.DeadlineScriptDialog import DeadlineScriptDialog

def main():

print "testing"[/b]

The weird thing is that they were working fine earlier today.

Hello James,

Noting changed on your repository or in the script between successful execution and failure? That is very odd.

Hi,
This error message line:

Value: ('invalid syntax', ('none', 19, 4, ' '))

normally means that you have a syntax (typo) error on line #19 of your custom script. If you want to attach the actual py script to this forum thread we can take a look for you.

So, it’s not allowing me to upload a file with a .py extension. But I posted the code from a very basic script in my original post. Even this code is failing for me.

[b]import clr
import sys

from System.IO import *

from Deadline.Scripting import *

from DeadlineUI.Controls.Scripting.DeadlineScriptDialog import DeadlineScriptDialog

def main():

print “testing”[/b]

See attached zip file. Extract the py file to \your_repo_path/custom/scripts/General/
Works fine for me. Is there any difference between mine and yours?

test.py.zip (656 Bytes)

Hmm, so that worked. The *args in the main is the only difference. But what’s weird is that the QuicktimeSubmission script doesn’t have that. And the even weirder thing is that my test scripts were working. Maybe I chanjged something without knowing it.

Thanks

Hi,

WARNING: replace any test in this post that looks like (code) or (/code) with SQUARE BRACKETS.

The “*args” addition in this context wouldn’t make any difference. You can remove it in your test example.

More than likely, it’s an “indent” or Python syntax error with a difference of 4 spaces or TABS or a mixture of 4 spaces & TABS being used in the same Python script to indent the code.
Although you can’t attach directly Python *.py files to the forum, you can compress/zip them up and attach the zip file. The forum doesn’t like TABS either, although you can wrap any code you want to post directly on the forum with (code) & (/code) wrappers around it, by pressing the “Code” button next to “Bold, Italics, Underline, Quote” buttons above. Unfortunately, the (code]) wrappers don’t like TABS either. However, it works with 4 spaces (replacement for TABS). Finally, note that all Deadline scripts now follow the industry standard of 4 SPACES instead of 1 TAB, so if you follow this convention, then posting (code) in the forum in the future should work well for you :slight_smile:

Any further issues, probably best to either zip the code up or do as above, then we can see where the issue is in the code more easily :slight_smile:

Hope this helps,
Mike

Example of (code) wrappers around Python code, thereby allowing indents to be shown + copy’ n 'paste to work correctly when sharing code.

[code]import clr
import sys

from System.IO import *

from Deadline.Scripting import *

from DeadlineUI.Controls.Scripting.DeadlineScriptDialog import DeadlineScriptDialog

def main():

print "testing"[/code]

Thanks for the info Mike. I’ve been pulled away to do some lighting tasks and I won’t be able to test this out right away. Once I get back to doing dev work I’ll look at this closer.

James