So I am having some troubles importing Pyro or Pyro4 while using IronPython as a C# ScriptEngine.
The import works fine if run directly in the ipy interpreter, but I receive the following error when ipy is initialized as a script engine from a c# script.
TypeErrorException: sequence item 0: expected bytes or byte array, str found
IronPython.Runtime.Operations.ByteOps.AppendJoin (System.Object value, Int32 index, System.Collections.Generic.List`1 byteList)
IronPython.Runtime.Bytes.join (System.Object sequence)
Microsoft.Scripting.Interpreter.FuncCallInstruction`3[IronPython.Runtime.Bytes,System.Object,IronPython.Runtime.Bytes].Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame)
Microsoft.Scripting.Interpreter.Interpreter.Run (Microsoft.Scripting.Interpreter.InterpretedFrame frame)
I am passing the -X:FullFrames and -X:Frames parameters to ipy at it's initialization already, so I believe I have ruled that out. In fact, this error happens whether or not I initialize with this parameters.
Here is my code in c#:
// Set the fullframes parameter in a dict
var options = new Dictionary<string, object>();
options["Frames"] = true;
options["FullFrames"] = true;
// create the engine
var ScriptEngine = IronPython.Hosting.Python.CreateEngine(options);
// and the scope (ie, the python namespace)
var ScriptScope = ScriptEngine.CreateScope();
//set the python file to execute
string scriptPath = "Assets\\test.py";
var ScriptSource = ScriptEngine.CreateScriptSourceFromFile(scriptPath);
And, of course, in the python script, I am receiving this error upon import of Pyro.
import Pyro
This error is typically obtuse for working with IPY, and I am stumped. Any insight at all, including any techniques to get a little more traceback would be of great help.
Thanks in advance!