Replies: 3 comments 6 replies
-
Just a thought: have you checked that the UTF-8 encoding you use is configured to work without the preamble? A BOM character can throw things off, although I would expect in such case |
Beta Was this translation helpful? Give feedback.
-
Weird one indeed. How are you initializing your engine and streaming the data? Do you get the same issue if you try with 3.4.0 or 3.4.1? |
Beta Was this translation helpful? Give feedback.
-
I found it! The host app does some custom trace handling. When a line of code contains Thanks for the suggestions! |
Beta Was this translation helpful? Give feedback.
-
I've been looking at updating a project that uses hosted IronPython2, but I hit a problem in IronPython3 when trying to import
importlib.util
:namedtuple
tries to build and thenexec
a class declaration, and fails.It looks like the underlying issue is that my hosted interpreter is unable to
exec
multiline expressions.That same expression is fine in IronPython3 Console ... so what's the problem with my hosted interpreter?
Some observations:
UTF8
toASCII
, theexec
expressions above work correctly, but I still see the same problem when I try to importimportlib.util
.__builtins__
is amodule
. In my hosted interpreter,__builtins__
is adict
. The__builtins__
variable appears on the scope during the call toSourceUnit.Execute
inMicrosoft.Scripting.Hosting.ScriptSource.Execute
the first timeScriptEngine.Execute
is called.IronPython 3.4.2
andIronPython.StdLib 3.4.2
nuget packages, and I've confirmed that the contents of theLib
folder used by my hosted interpreter are identical to those distributed with IronPython Console (except for a fewpip
-related packages that are only present in the latter).Here's the traceback from the
importlib.util
problem, which I see however I importutil
, and with bothASCII
andUTF8
stream encoding:Beta Was this translation helpful? Give feedback.
All reactions