Quantcast

about fork and termios

classic Classic list List threaded Threaded
2 messages Options
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

about fork and termios

Sven Aßmann
Hi Folks,

starting from the ssl tests from cpython i went into one more strange issues:

import fork with cpython:

>>> from pty import fork
>>> fork                      
<function fork at 0x7f599d12ab18>


and try with jython27:

>>> from pty import fork
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/jython27/Lib/pty.py", line 11, in <module>
    import tty
  File "/opt/jython27/Lib/tty.py", line 5, in <module>
    from termios import *
ImportError: No module named termios


in cpython the termios seems to be available as shared library. On jython i
not find anything comparable. Is this still missing? Or is there no real
replacement for this because native library dependencies may are not wanted?


--
Sven

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev
Reply | Threaded
Open this post in threaded view
|  
Report Content as Inappropriate

Re: about fork and termios

Alan Kennedy-2
HI Sven,

Terminal control is one of those areas where java works very differently to the standard *nix way of thinking, because it must be multi-platform.

Our console situation is already complex and hard to maintain: Jeff has just put in a lot of work to get the jline support working cross platform, especially windows.

Cpython pty module is not designed to be portable. As the documentation states: "Because pseudo-terminal handling is highly platform dependent, there is code to do it only for Linux. (The Linux code is supposed to work on other platforms, but hasn’t been tested yet.)". So it is highly unlikely that the code will work out of the box on jython/java.

http://docs.python.org/2/library/pty.html

Likewise, the cpython termios module is marked as "Unix only". Although you may be running jython on unix, it is still running on a JVM, and thus it's IO is limited to java capabilities.

http://docs.python.org/2/library/termios.html

That said, we do have a lot of posix support, by virtue of the JNR posix library.

https://github.com/jnr/jnr-posix

So it might be possible to implement the pty and termios modules using JNR. You could file a bug report to at least record the requirement.

Alan.



On Tue, Feb 11, 2014 at 11:36 PM, Sven Aßmann <[hidden email]> wrote:
Hi Folks,

starting from the ssl tests from cpython i went into one more strange issues:

import fork with cpython:

>>> from pty import fork
>>> fork
<function fork at 0x7f599d12ab18>


and try with jython27:

>>> from pty import fork
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/opt/jython27/Lib/pty.py", line 11, in <module>
    import tty
  File "/opt/jython27/Lib/tty.py", line 5, in <module>
    from termios import *
ImportError: No module named termios


in cpython the termios seems to be available as shared library. On jython i
not find anything comparable. Is this still missing? Or is there no real
replacement for this because native library dependencies may are not wanted?


--
Sven

------------------------------------------------------------------------------
Android apps run on BlackBerry 10
Introducing the new BlackBerry 10.2.1 Runtime for Android apps.
Now with support for Jelly Bean, Bluetooth, Mapview and more.
Get your Android app in front of a whole new audience.  Start now.
http://pubads.g.doubleclick.net/gampad/clk?id=124407151&iu=/4140/ostg.clktrk
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev


------------------------------------------------------------------------------
Managing the Performance of Cloud-Based Applications
Take advantage of what the Cloud has to offer - Avoid Common Pitfalls.
Read the Whitepaper.
http://pubads.g.doubleclick.net/gampad/clk?id=121054471&iu=/4140/ostg.clktrk
_______________________________________________
Jython-dev mailing list
[hidden email]
https://lists.sourceforge.net/lists/listinfo/jython-dev
Loading...