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.


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.


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


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.


On Tue, Feb 11, 2014 at 11:36 PM, Sven A▀mann <sven.assmann@lubico.biz> 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?


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.
Jython-dev mailing list