1

Closed

IronPython Interactive fails to interpret Console.WriteLine(1)

description

The following code fails to run in IronPython 2.7 Interactive:

import clr
from System import Console
Console.WriteLine(1)

Here's the error:

>>> import clr
...
>>> from System import Console
...
>>> Console.WriteLine(1)
...
1Traceback (most recent call last):
File "<string>", line 1, in <module>
File "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\1.1\visualstudio_py_repl.py", line 983, in WriteLine
super(DotNetOutput, self).WriteLine(value)
TypeError: WriteLine() takes at least 2 arguments (1 given)

No files are attached

Closed Apr 11 at 9:39 PM by weidongh

comments

dinov wrote Feb 9 at 5:08 PM

Fixed in main - http://pytools.codeplex.com/SourceControl/changeset/changes/aeef1524186b

dinov wrote Feb 9 at 4:59 PM

Thanks for the report. You can change "c:\Program Files (x86)\Microsoft Visual Studio 10.0\Common7\IDE\Extensions\Microsoft\Python Tools for Visual Studio\1.1\visualstudio_py_repl.py" and replace the line:

super(DotNetOutput, self).WriteLine(value)

with:

super(DotNetOutput, self).WriteLine.Overloads[object](value)

to work around this.