Message6712

Author irmen
Recipients irmen, jackgene, samwyse
Date 2011-11-06.23:27:26
SpamBayes Score 8.374897e-07
Marked as misclassified No
Message-id <1320622046.55.0.111642636543.issue1787@psf.upfronthosting.co.za>
In-reply-to
Content
Actually the problem is not getpass itself, but sys.stdin.readline.

If you type this in a jython prompt it will hang the same way:

import sys; sys.stdin.readline()


Digging a bit further it seems there are some bugs in TextIOWrapper.read().   It looks for '\r' and '\n' characters but it appears that reading from the console through that underlying readahead buffer gives different characters for Enter (returns CR instead of LF), EOF (ctrl-Z, returns char code 26), and it even swallows CTRL-C as a 'normal' character with code 3 (ETX) and CTRL-D as 4 (EOT). This screws up the handling of the characters and the loop never exits.

I don't have any experience with java nio to tell what's going on here.
History
Date User Action Args
2011-11-06 23:27:26irmensetmessageid: <1320622046.55.0.111642636543.issue1787@psf.upfronthosting.co.za>
2011-11-06 23:27:26irmensetrecipients: + irmen, jackgene, samwyse
2011-11-06 23:27:26irmenlinkissue1787 messages
2011-11-06 23:27:26irmencreate