You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Maybe this is a regression based on the PR here, seemingly indicating that it was the fix to make IronPython3 work with Blazor: IronLanguages/dlr#256
Though this issue remained open on IronPython2 (but again indicated the scenario should work in IronPython3): IronLanguages/ironpython2#769
I'm in an Uno Platform WASM context (should be the same as Blazor). And when I tried to call CreateEngine I got this exception (which looks like it's trying to find the console, though that was what the above PR was supposed to fix?):
System.Reflection.TargetInvocationException: Failed to load language 'IronPython 3.4.2': Operation is not supported on this platform.
---> System.PlatformNotSupportedException: Operation is not supported on this platform.
at System.ConsolePal.get_InputEncoding()
at System.Console.get_InputEncoding()
at Microsoft.Scripting.Runtime.SharedIO.InitializeInput()
at Microsoft.Scripting.Runtime.SharedIO.get_InputEncoding()
at IronPython.Modules.PythonIOModule.CreateConsole(PythonContext context, SharedIO io, ConsoleStreamType type, String name, StreamBox& sio)
at IronPython.Runtime.PythonContext.SetStandardIO()
at IronPython.Runtime.PythonContext.InitializeSystemState()
at IronPython.Runtime.PythonContext..ctor(ScriptDomainManager manager, IDictionary`2 options)
at System.Object.InvokeStub_PythonContext..ctor(Object , Span`1 )
at System.Reflection.MethodBaseInvoker.InvokeWithFewArgs(Object obj, BindingFlags invokeAttr, Binder binder, Object[] parameters, CultureInfo culture)
--- End of inner exception stack trace ---
at Microsoft.Scripting.Runtime.LanguageConfiguration.LoadLanguageContext(ScriptDomainManager domainManager, Boolean& alreadyLoaded)
at Microsoft.Scripting.Runtime.DlrConfiguration.LoadLanguageContext(ScriptDomainManager manager, LanguageConfiguration config)
at Microsoft.Scripting.Runtime.DlrConfiguration.TryLoadLanguage(ScriptDomainManager manager, AssemblyQualifiedTypeName& providerName, LanguageContext& language)
at Microsoft.Scripting.Runtime.ScriptDomainManager.GetLanguageByTypeName(String providerAssemblyQualifiedTypeName)
at Microsoft.Scripting.Hosting.ScriptRuntime.GetEngineByTypeName(String assemblyQualifiedTypeName)
at IronPython.Hosting.Python.GetEngine(ScriptRuntime runtime)
at IronPython.Hosting.Python.CreateEngine()
Perhaps some similar try/catch fallback helper logic to IronLanguages/dlr#256 needs to be implemented here?
I don't need input in my scenario, and plan to redirect the output already. Though not sure if there'd be other blockers beyond this.
Already been poking at this too late today, but will see if I can build the repo and investigate, VS doesn't seem to let me step-in to the function in the WASM debug context for some reason.
The text was updated successfully, but these errors were encountered:
Thanks @slozier, much appreciated! Just turning off the ConsoleSupportLevel option seems to work now for the simple stuff I'm doing.
Will report if I have any other issues, could still be good to call out in the docs somewhere, I didn't see anything on configuration options for instance. And/or wrap the exception to bubble up that as a suggestion within the error itself.
Maybe this is a regression based on the PR here, seemingly indicating that it was the fix to make IronPython3 work with Blazor: IronLanguages/dlr#256
Though this issue remained open on IronPython2 (but again indicated the scenario should work in IronPython3): IronLanguages/ironpython2#769
I'm in an Uno Platform WASM context (should be the same as Blazor). And when I tried to call
CreateEngine
I got this exception (which looks like it's trying to find the console, though that was what the above PR was supposed to fix?):Perhaps some similar try/catch fallback helper logic to IronLanguages/dlr#256 needs to be implemented here?
ironpython3/src/core/IronPython/Runtime/PythonContext.cs
Lines 1862 to 1868 in 71a8f5c
I don't need input in my scenario, and plan to redirect the output already. Though not sure if there'd be other blockers beyond this.
Already been poking at this too late today, but will see if I can build the repo and investigate, VS doesn't seem to let me step-in to the function in the WASM debug context for some reason.
The text was updated successfully, but these errors were encountered: