Issue1984

classification
Title: os.pipe() missing
Type: behaviour Severity: major
Components: Library Versions: Jython 2.7
Milestone: Jython 2.7.1
process
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: darjus, fwierzbicki, gary.aviv, xingyong, zyasoft
Priority: low Keywords:

Created on 2012-11-06.17:13:03 by gary.aviv, last changed 2015-11-16.01:01:26 by darjus.

Messages
msg7509 (view) Author: gary aviv (gary.aviv) Date: 2012-11-06.17:17:35
The pipe function is missing from os module; this is Linux JRE java1.7.0_b147-icedtea 64 bits. It is also missing from 2.5.3.  

import os
x,y = os.pipe()

we get:

AttributeError: 'module' object has no attribute 'pipe'
msg8663 (view) Author: Xing Yong (xingyong) Date: 2014-06-18.11:37:42
when can we fix this problem? Does anyone have some plan?
msg8664 (view) Author: Jim Baker (zyasoft) Date: 2014-06-18.17:36:31
Windows does support os.pipe, but apparently this is only useful for threads communicating in the *same* process.

However, the normal usage is with os.fork, which we cannot support on the JVM until the JVM itself supports such forking. (Something that has been advocated for Java 9.) So this makes supporting os.pipe very low priority.

With this analysis, I'm going to put this in "postponed" because the use case is so narrow and there are much better communication mechanisms. However, a pure Python patch that implements this in terms of StringIO is probably the right way to do it (see _socket._fileobject, not certain if there's something we could use that's more direct)
msg10472 (view) Author: Darjus Loktevic (darjus) Date: 2015-11-14.04:29:02
Jim, what do you think of this?
https://github.com/jythontools/jython/pull/22
msg10473 (view) Author: Jim Baker (zyasoft) Date: 2015-11-14.05:09:26
I missed the PR, not to mention the fact that we can get this underlying functionality in java.nio.channels.Pipe. Assuming this change passes tests on os.pipe, it looks great! Changing milestone to 2.7.1 under this assumption.

There are many Twisted tests that could benefit from this functionality, so let's get it in.
msg10474 (view) Author: Darjus Loktevic (darjus) Date: 2015-11-14.10:13:37
Great, will try to pull the PRs in.
msg10482 (view) Author: Darjus Loktevic (darjus) Date: 2015-11-16.01:01:26
Thanks to Stephen Drake this should now be available for 2.7.1 https://github.com/jythontools/jython/commit/be1de11d4471555de9447d0a676ad4047c4b335d
History
Date User Action Args
2015-11-16 01:01:26darjussetstatus: open -> closed
messages: + msg10482
2015-11-14 10:13:37darjussetmessages: + msg10474
2015-11-14 05:09:26zyasoftsetresolution: postponed -> accepted
messages: + msg10473
milestone: Jython 2.7.1
2015-11-14 04:29:02darjussetnosy: + darjus
messages: + msg10472
2014-06-18 17:36:32zyasoftsetresolution: postponed
messages: + msg8664
nosy: + zyasoft
2014-06-18 16:21:13santa4ntsettype: behaviour
2014-06-18 11:38:30xingyongsetversions: + Jython 2.7, - Jython 2.5
2014-06-18 11:37:42xingyongsetnosy: + xingyong
messages: + msg8663
2013-02-25 21:50:27fwierzbickisetpriority: low
nosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.2
2012-11-06 17:17:36gary.avivsetmessages: + msg7509
2012-11-06 17:13:03gary.avivcreate