AWS Thinkbox Discussion Forums

printing dictionaries in deadline crashes

This worked in deadline7, and also works in dpython. But it fails when running in the cpython embedded into the slave/monitor etc:

myDict={5:19}
print('%s'%myDict)

I get the following exception:

2016-01-11 18:42:25: Running script test2 (\inferno2\deadline\repository8\scripts\Jobs\test2.py)
2016-01-11 18:42:25: Traceback (most recent call last):
2016-01-11 18:42:25: File “c:\FranticRegressions\DL_Main\git-01_deadline_deadline\DeadlineProject\DeadlineUI\UI\Commands\ScriptCommands.py”, line 112, in InnerExecute
2016-01-11 18:42:25: PythonNetException: FormatException : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
2016-01-11 18:42:25: at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
2016-01-11 18:42:25: at System.String.Format(IFormatProvider provider, String format, Object[] args)
2016-01-11 18:42:25: at Deadline.Scripting.DeadlineScriptManagerOutput.WriteLine(String text)
2016-01-11 18:42:25: File “\inferno2\deadline\repository8\scripts\Jobs\test2.py”, line 2, in
2016-01-11 18:42:25: print(’%s’%myDict)
2016-01-11 18:42:25: File “none”, line 11, in write
2016-01-11 18:42:25: File “none”, line 24, in flush

test2.py just has the above 2 lines in it.

Also tried pprint, fails with a similar error:

import pprint
myDict={5:19}
pprint.pprint(myDict)

2016-01-11 18:45:05: Running script test2 (\inferno2\deadline\repository8\scripts\Jobs\test2.py)
2016-01-11 18:45:05: Traceback (most recent call last):
2016-01-11 18:45:05: File “c:\FranticRegressions\DL_Main\git-01_deadline_deadline\DeadlineProject\DeadlineUI\UI\Commands\ScriptCommands.py”, line 112, in InnerExecute
2016-01-11 18:45:05: PythonNetException: FormatException : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
2016-01-11 18:45:05: at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
2016-01-11 18:45:05: at System.String.Format(IFormatProvider provider, String format, Object[] args)
2016-01-11 18:45:05: at Deadline.Scripting.DeadlineScriptManagerOutput.WriteLine(String text)
2016-01-11 18:45:05: File “\inferno2\deadline\repository8\scripts\Jobs\test2.py”, line 3, in
2016-01-11 18:45:05: pprint.pprint(myDict)
2016-01-11 18:45:05: File “C:\Program Files\Thinkbox\Deadline8\bin\lib\pprint.py”, line 59, in pprint
2016-01-11 18:45:05: printer.pprint(object)
2016-01-11 18:45:05: File “C:\Program Files\Thinkbox\Deadline8\bin\lib\pprint.py”, line 118, in pprint
2016-01-11 18:45:05: self._stream.write("\n")
2016-01-11 18:45:05: File “none”, line 11, in write
2016-01-11 18:45:05: File “none”, line 24, in flush

Hey Laszlo,

I have not been able to reproduce this behavior on the latest deadline 8 build.

Does doing

print '{0}'.format(myDict)

give you the same result?

Also can you send me the deadline version you are working on.
Thanks
-Bhavek

We are on beta 3 (beta 4 was redacted and beta 5 has excessive cpu usage for the web service, so we are skipping that)

I get the same error with that line too:

myDict={5:19}
print '{0}'.format(myDict)

2016-01-12 09:31:09: Running script test2 (\inferno2\deadline\repository8\scripts\Jobs\test2.py)
2016-01-12 09:31:09: Traceback (most recent call last):
2016-01-12 09:31:09: File “c:\FranticRegressions\DL_Main\git-01_deadline_deadline\DeadlineProject\DeadlineUI\UI\Commands\ScriptCommands.py”, line 112, in InnerExecute
2016-01-12 09:31:09: PythonNetException: FormatException : Index (zero based) must be greater than or equal to zero and less than the size of the argument list.
2016-01-12 09:31:09: at System.Text.StringBuilder.AppendFormat(IFormatProvider provider, String format, Object[] args)
2016-01-12 09:31:09: at System.String.Format(IFormatProvider provider, String format, Object[] args)
2016-01-12 09:31:09: at Deadline.Scripting.DeadlineScriptManagerOutput.WriteLine(String text)
2016-01-12 09:31:09: File “\inferno2\deadline\repository8\scripts\Jobs\test2.py”, line 2, in
2016-01-12 09:31:09: print ‘{0}’.format(myDict)
2016-01-12 09:31:09: File “none”, line 11, in write
2016-01-12 09:31:09: File “none”, line 24, in flush
2016-01-12 09:31:09:

I just saw beta6 being posted, ill try with that as soon as possible

I can confirm that this works in beta6 as expected!

cheers
laszlo

Privacy | Site terms | Cookie preferences