Message8111

Author jeff.allen
Recipients jeff.allen
Date 2013-09-09.22:11:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1378764671.78.0.0282161693827.issue2082@psf.upfronthosting.co.za>
In-reply-to
Content
Ok, I have to own up to this one. The mechanism of the problem is that these tests replace sys.stdin and sys.stdout, and then call raw_input('(Pdb)') which is supposed to use the replacement streams.

In the present implementation, raw_input(prompt) is handled by the console class directly, so replacing sys.stdin/stdout does not intercept it. This direct delegation happens even with the PlainConsole. I did this so that the console library (JLine or Readline) could be aware of the prompt, which it needs to be in order to position the cursor correctly - one of the things this design fixed.

Prior to my change, the JLineConsole would replace raw_input() with a method it implemented directly, and this is why test_pdb and test_doctest fail the same way in versions before my change. (But they don't fail when the console is InteractiveConsole.) This hijacking was incorrect, and now I've generalised it.

Replacing sys.stdin/stdout is not uncommon in Python, so it should work in Jython as it does in CPython. I'll see what I can do to restore that for all consoles, achieving correct line editing some other way.
History
Date User Action Args
2013-09-09 22:11:11jeff.allensetmessageid: <1378764671.78.0.0282161693827.issue2082@psf.upfronthosting.co.za>
2013-09-09 22:11:11jeff.allensetrecipients: + jeff.allen
2013-09-09 22:11:11jeff.allenlinkissue2082 messages
2013-09-09 22:11:11jeff.allencreate