[Ironpython-users] IronPython, Daily Digest 12/18/2013

CodePlex no_reply at codeplex.com
Thu Dec 19 09:28:31 CET 2013

Hi ironpython,

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

In today's digest:ISSUES

1. [New issue] Should subprocess Work On Mono?



1. [New issue] Should subprocess Work On Mono?
User TeddyP has proposed the issue:

"I've spent the last couple of days doing searches, digging through code, looking at old forum posts, looking at online documentation, and checking the mailing list. I'm still not sure so I'll throw it out there:

Should I be able to import the subprocess module and use it on Mono (because I don't seem to be able to)?

If I should, any ideas on what I'm doing wrong? If I shouldn't, is there:

Intent to have it work in the future? If so, is there an issue # or something I could be tracking against?

Any documentation that makes this clear?

I'm using the following versions/systems:

IronPython v2.7.3
Xubuntu 13.10 64-bit running Mono (Debian
Windows 7 Enterprise 64-bit running .NET Framework 4.5.1 (and a few of the older .NET versions as well)
...>"C:\Program Files (x86)\IronPython 2.7\ipy64.exe"
IronPython 2.7.3 ( on .NET 4.0.30319.18408 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess

I can proceed and do things like subprocess.call('<some program>') just fine.
...$ mono ../IronPython/ipy64.exe
IronPython 2.7.3 ( on Mono 4.0.30319.1 (64-bit)
Type "help", "copyright", "credits" or "license" for more information.
>>> import subprocess
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "../IronPython/Lib/subprocess.py", line 430, in <module>
ImportError: No module named fcntl

Some things I looked at when trying to figure this out:

IronPython Work Item 15512: Seems to indicate subprocess was implemented and working as of 2.7B2 (other release notes and mailing list items seem to back this up). Not explicit if it was tested/supposed to be working on Mono or not, but it seems that by default the assumption should be yes unless it explicitly says otherwise.
IronPython Work Item 23983: Similar to the other one. Also marked as closed out.
IronPython FAQ: I didn't see anything about it in the FAQ
IronPython Mailing List Archive: Didn't appear to be anything recent (lots of stuff back from pre-2.7B2 and then with the fix in 2.7B2)

IronPython Cookbook: Launching Sub-Processes: Provides a workaround using System.Diagnostic.Processes instead of subprocess that still works. Has some links to a partial subprocess module implementation in C# written by jdhardy back in 2008 (who I see is still heavily involved and a coordinator in this project). Not sure if that was ever completed or integrated into IronPython (I don't see it in the source code package from 2.7.3 though). Other link is dead. The cookbook page says Because the select module is not available, you can't use the subprocess module in IronPython. I'm guessing that is somewhat outdated, as the select module doesn't seem to have anything to do with the current issue (possibly back in 2007 when it was written) and there haven't been any significant updates to that page since it was first written.

Looking at the source code for subprocess.py, what appears to keep the module from being loaded (unknown if it would work even if you got it loading, but hey...) is listed below. Note that these assume the POSIX codepath is the one that should be taken (which is what currently is being taken; if ultimately the Windows codepath is what we are going for, a different set of changes would need to be made to subprocess.py).

Missing fcntl module. This is a Unix specific module that is a built-in module provided by the Python interpreter itself on Linux. The IronPython interpreter does not have fcntl as a built-in. The uses of fcntl by subprocess are all fairly contained around safely/properly handling duplicated stdio handles when child processes are spawned. The particular symbols missing are the fcntl function itself, FD_CLOEXEC, F_GETFD, and F_SETFD.

Missing certain members from the os module. In particular the WIFSIGNALED, WTERMSIG, WIFEXITED, WEXITSTATUS, and WNOHANG symbols. Even though they are from the os module, the os module actually gets them from the posix module on Linux. Now the posix module is present with IronPython but it doesn't have these symbols. All of the uses of these symbols in subprocess are fairly well contained as well and deal with properly waiting for and setting the return code for the exiting child process.

Any thoughts?"

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/20131219/6cf8a78a/attachment.html>

More information about the Ironpython-users mailing list