[IronPython] IronPython 2 Bug - code module and InteractiveInterpreter (stdout swallowed or not appearing)

Michael Foord fuzzyman at voidspace.org.uk
Wed Sep 19 15:22:57 CEST 2007


Hello all (again),

A simpler way of reproducing the bug is as follows:

IronPython 1 and CPython
 >>> c = compile('3', 'test', 'single', 0, 1)
 >>> exec c
3
 >>>

IronPython 2
 >>> c = compile('3', 'test', 'single', 0, 1)
 >>> exec c
 >>>

I have a 'proof-of-concept' interpreter that runs in the browser, but 
this bug makes it not so fun. :-(

Michael Foord
http://www.ironpython.info/




Michael Foord wrote:
> Hello all,
>
> There is an annoying bug with IronPython 2 which is blocking me from 
> implementing an 'interactive interpreter in the browser'.
>
> I'm afraid I can only show how to reproduce the bug rather than 
> diagnose the cause.
>
> When executing code with the 'InteractiveInterpreter' class from the 
> standard library code module, the result of the last expression is 
> sent to stdout. This mirrors the behaviour of the normal Python 
> interactive interpreter.
>
> In IronPython 1.1 this works fine - and I can trap the output by 
> replacing 'sys.stdout' with my own Python object.
>
> In IronPython 2, this output just doesn't appear. :-(
>
> If you run 'test_console.py' (with the other attached files in the 
> same directory) with IronPython 1.1 it will print the following line 
> to standard out "Received (out) : 3Received (out) :".
>
> If you run it with IronPython 2 (I've tried it with both Silverlight 
> and 2.0a4) it outputs nothing.
>
> This is a darn shame because having an interactive interpreter in the 
> browser is way cool...
>
> Michael Foord
> http://www.manning.com/foord
>
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> Users mailing list
> Users at lists.ironpython.com
> http://lists.ironpython.com/listinfo.cgi/users-ironpython.com




More information about the Ironpython-users mailing list