[Ironpython-users] IronPython, Daily Digest 3/17/2012

no_reply at codeplex.com no_reply at codeplex.com
Sun Mar 18 13:51:22 CET 2012


Hi ironpython,

Here's your Daily Digest of new issues for project "IronPython".

In today's digest:ISSUES

1. [New issue] 2.7.2.1: ast.py fails on Lib/subprocess.py
2. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py
3. [New comment] pyc.py: generates exes which fail on using std python libs
4. [New comment] pyc.py: generates exes which fail on using std python libs
5. [New issue] Func<object> coersions in IList

----------------------------------------------

ISSUES

1. [New issue] 2.7.2.1: ast.py fails on Lib/subprocess.py
http://ironpython.codeplex.com/workitem/32446
User ddewaleffe has proposed the issue:

"Parsing with ast module fails in subprocess.py:

bash-3.2$ ipy ipy-bug.py
Parsing file: c:\s\ipy27\Lib\subprocess.py
Got exception while parsing
Traceback (most recent call last):
  File "ipy-bug.py", line 8, in <module>
    root=ast.parse(src,filename)
  File "C:\s\ipy27\Lib\ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
TypeError: Unexpected expression type: IronPython.Compiler.Ast.SetExpression
bash-3.2$

Attached is the way to reproduce (module path to the file)..."-----------------

2. [New comment] 2.7.2.1: ast.py fails on Lib/subprocess.py
http://ironpython.codeplex.com/workitem/32446
User ddewaleffe has commented on the issue:

"Also fails in random.py:
Parsing file: C:\s\ipy27\Lib\random.py
Got exception while parsing or visiting nodes: returning what we have so far...
Traceback (most recent call last):
  File "C:\Users\ddw\Documents\0-dropbox\My Dropbox\Prg\ipy\finddeps.py", line 55, in dire
ct_deps
    root=ast.parse(src,self.filename)
  File "C:\s\ipy27\Lib\ast.py", line 37, in parse
    return compile(source, filename, mode, PyCF_ONLY_AST)
ValueError: Unexpected PyOperator: TrueDivide
Parameter name: op

Probably good to add a test that tries parsing all the source libs provided ..."-----------------

3. [New comment] pyc.py: generates exes which fail on using std python libs
http://ironpython.codeplex.com/workitem/32420
User ddewaleffe has commented on the issue:

"I attach findeps.py and my modified pyc.py (packaged in zip)

This relies on ast.py to recursively find imports and generate a list of files to be compiled along the main ones.
It works for the small examples I tried.
It may miss dependencies if ast.py fails to parse a source file (e.g: subprocess.py, random.py)
"-----------------

4. [New comment] pyc.py: generates exes which fail on using std python libs
http://ironpython.codeplex.com/workitem/32420
User slide_o_mix has commented on the issue:

"What license would you attribute to finddeps.py? I think we would need it something similar to Apache in order to include it."-----------------

5. [New issue] Func<object> coersions in IList
http://ironpython.codeplex.com/workitem/32451
User dsblank has proposed the issue:

"These two C# functions behave very differently when passed IronPython functions (PythonFunction, builtin, lambda, etc):

public void function1(params Func<object> [] functions) {
   foreach (Func<object> function in functions) {
       function();
   }
}
public void function2(IList<Func<object>> functions) {
   foreach (Func<object> function in functions) {
       function();
   }
}

The first works as expected and executes the code. The second can't convert the IronPython function to a Func<object>.

Workaround:

public void function3 (IList<dynamic> functions) {
    foreach (dynamic function in functions) {
         Func<object> func = IronPython.Runtime.Converter.Convert<Func<object>>(function);
         func();
    }
}

[Tested in MonoDevelop for .NET 4 on Windows7 64-bit. Need to include System.Core and Microsoft.CSharp.]

Dino says in mailing list Mar 17, 2012:

"""
...this doesn't so much deal with [two different paths] rather than how our IList<T> wrapper is implemented in ConversionWrappers.cs. The indexer is just doing a C# cast from the value to the T type.  That could easily be changed to do a full Python conversion.

I think doing an is check first and only doing the conversion if it's not already the proper type would be an alright change.  But it could be a little surprising in that sometimes you could get a new instance each time you access an element (e.g. a new delegate could be created each time).
"""
-Doug"
----------------------------------------------



----------------------------------------------
You are receiving this email because you subscribed to notifications on CodePlex.

To report a bug, request a feature, or add a comment, visit IronPython Issue Tracker. You can unsubscribe or change your issue notification settings on CodePlex.com.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/ironpython-users/attachments/20120318/3c6a6dda/attachment.html>


More information about the Ironpython-users mailing list