Title: getpass.getpass echoes input
Type: Severity: normal
Components: Library Versions: 2.5.1
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: zyasoft Nosy List: mleinart, umairghani, zyasoft
Priority: normal Keywords:

Created on 2010-07-06.17:07:56 by umairghani, last changed 2015-01-17.18:31:54 by zyasoft.

File name Uploaded Description Edit Remove umairghani, 2010-07-06.17:07:53 Fixed
msg5874 (view) Author: Umair Ghani (umairghani) Date: 2010-07-06.17:07:52
The default Python getpass library uses termios, which is a shared C library object. Jython does not recognize this file, because it uses the JDK. Attempting to import termios causes the getpass module to throw an import error, forcing the default getpass (raw_input) to be called, thusly causing the plaintext password to be displayed on-screen.

In attempts to fix this issue, I instead imported java.lang.System.console, which is only available in JDK >= 1.6. (,%20java.lang.Object...%29)

I'm attaching a revised getpass module (${JYTHON_HOME}/Lib/ which utilizes this import method.
msg5901 (view) Author: Jim Baker (zyasoft) Date: 2010-07-16.23:06:41
Perhaps this should use JLineConsole support (which would almost certainly be the default) instead; that would also work with Java 5 users.

The relevant method is, however we don't currently expose the Terminal object (see org.python.util.JLineConsole#reader).
msg6016 (view) Author: Jim Baker (zyasoft) Date: 2010-08-25.06:04:00
As of r7098 we now make the PythonInterpreter available in sys._jy_interpreter, so we can perform disableEcho.

This should be part of 2.5.2
msg6194 (view) Author: Jim Baker (zyasoft) Date: 2010-10-22.01:13:56
Now uses JLine support by disabling echo. This works on Java 5 too.

Fixed in r7162
msg9417 (view) Author: Jim Baker (zyasoft) Date: 2015-01-17.18:31:54
Somehow getpass.getpass started echoing again in 2.7. So we upgraded to JLine2 to fix (#2092)
Date User Action Args
2015-01-17 18:31:54zyasoftsetmessages: + msg9417
2010-10-22 01:13:57zyasoftsetstatus: open -> closed
assignee: zyasoft
resolution: fixed
messages: + msg6194
title: getpass (unix/linux) does not work in jython 2.5.1 -> getpass.getpass echoes input
2010-08-25 06:04:00zyasoftsetpriority: normal
messages: + msg6016
2010-07-16 23:06:42zyasoftsetnosy: + zyasoft
messages: + msg5901
2010-07-06 17:48:38mleinartsetnosy: + mleinart
2010-07-06 17:07:56umairghanicreate