IronPython 1.0 - Bugs or Features?

Claudio Grondi claudio.grondi at freenet.de
Wed Sep 6 10:18:39 EDT 2006


(just wanted to share my experience with IronPython 1.0)

The context:
   C:\IronPython> ipy.exe
   IronPython 1.0.60816 on .NET 2.0.50727.42
   Copyright (c) Microsoft Corporation. All rights reserved.
vs.
   C:\Python24> python.exe
   Python 2.4.2 (#67, Sep 28 2005, 12:41:11) [MSC v.1310 32 bit (Intel)] 
on win32

IronPython raises "UnboundLocalError: local variable 'strData' 
referenced before assignment" error in following case:
<code>
     while(someCondition):
       try:
         strData = strSomeValue()
       except:
         pass
       if( type(strData) == str ) : ### <<< HERE THE ERROR
         doSomething()
</code>
CPython 2.4.2 doesn't raise an error with same code.

As strData is not set anywhere before in the code it seems, that 
IronPython is somehow right, but I am not sure if it is a bug or a feature.

Another problem with IronPython where CPython 2.4.2 runs ok was while I 
was trying to do:
   f = file(r'\\.\PhysicalDrive0', 'rb')
getting "ValueError: FileStream will not open Win32 devices such as disk 
partitions and tape drives. Avoid use of "\\.\" in the path."
Here the same - I am not sure if it is a bug or a feature.

Can someone knowledgeable elaborate on it a bit please?

Claudio Grondi



More information about the Python-list mailing list