[IronPython] Error while porting Linux code to IronPython

Michael Foord fuzzyman at voidspace.org.uk
Mon May 28 13:11:56 CEST 2007


Anthony Raj wrote:
>
> Hi All,
>
> Currently have an error while porting code from Linux to Windows 
> environment.
>
> We have the code working as web calls on linux. Now we’re trying to do 
> a performance
>
> analysis of the same code running on windows using ironpython.
>
> Basically we are trying to integrate our linux product with a Windows 
> counterpart and
>
> facing some errors in the Python code.
>
> The error is in the class having global variables defined –
>
> >>>
>
> class parser:
>
> leafNodesDict = dict()
>
> usedInNodesDict = dict()
>
> requiredNodesDict = dict()
>
> optionalNodesDict = dict()
>
> >>>
>

Hello Anthony,

The code you have posted works fine for me.

The error would indicate that somewhere in your code you have redefined 
'dict' by using it as a variable name.

Try replacing them with dict literals - {}. If the problem goes away 
then that is probably the problem.

Michael
http://www.voidspace.org.uk/ironpython/index.shtml

> C:\IronPython-1.1>ipy.exe Lib/ast/parser.py
>
> Traceback (most recent call last):
>
> File C:\IronPython-1.1\Lib\ast\parser.py, line 36, in Initialize
>
> File C:\IronPython-1.1\Lib\ast\parser.py, line 37, in parser
>
> TypeError: Dictionary object is not callable
>
> Now line 37 is “leafNodesDict = dict()”
>
> The same code works perfectly in linux.
>
> Tried moving the global variables inside def __init__() method.
>
> It still breaks with the same error.
>
> Another point – the error is the same when run using CPython.
>
> Iron Python Version
>
> C:\IronPython-1.1>ipy.exe
>
> IronPython 1.1 (1.1) on .NET 2.0.50727.42
>
> Copyright (c) Microsoft Corporation. All rights reserved.
>
> >>>
>
> CPython Version
>
> C:\IronPython-1.1>ipy.exe
>
> IronPython 1.1 (1.1) on .NET 2.0.50727.42
>
> Copyright (c) Microsoft Corporation. All rights reserved.
>
> >>>
>
> Some pointers would be very helpful.
>
> TIA,
>
> Anthony
>
> DISCLAIMER ========== This e-mail may contain privileged and 
> confidential information which is the property of Persistent Systems 
> Pvt. Ltd. It is intended only for the use of the individual or entity 
> to which it is addressed. If you are not the intended recipient, you 
> are not authorized to read, retain, copy, print, distribute or use 
> this message. If you have received this communication in error, please 
> notify the sender and delete all copies of this message. Persistent 
> Systems Pvt. Ltd. does not accept any liability for virus infected mails.
>
> ------------------------------------------------------------------------
>
> _______________________________________________
> 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