-
Notifications
You must be signed in to change notification settings - Fork 770
Closed
Description
Environment
- Pythonnet version: 2.4.0.dev
- Python version: 3.7
- Operating System: Win10
Details
- I have a script, represented by a string in .net side:
string script = "a = \"Привет\"";
I try to run this script, using PyScope.Exec()
public void ExecuteScript(string script, IDictionary<string, object> locals)
{
_scriptLocals = new PyDict();
using (Py.GIL())
{
if (locals != null)
foreach (var local in locals)
_scriptLocals[local.Key] = local.Value.ToPython();
using (var pythonScope = Py.CreateScope())
{
pythonScope.Exec(script, _scriptLocals);
}
}
}
When I run method pythonScope.Exec(script, _scriptLocals), I get an exception:
SyntaxError : ("(unicode error) 'utf-8' codec can't decode byte 0xcf in position 0: invalid continuation byte", ('', 1, 4, None))
StackTrace is empty
Metadata
Metadata
Assignees
Labels
No labels