classification
Title: IDLE and Command line present different behavior for sys.stdin
Type: Stage:
Components: IDLE, IO Versions: Python 3.1
process
Status: open Resolution:
Dependencies: Superseder:
Assigned To: Nosy List: Geraldo.Xexeo, taleinat
Priority: normal Keywords:

Created on 2010-07-18 01:51 by Geraldo.Xexeo, last changed 2010-07-20 14:42 by taleinat.

Messages (2)
msg110621 - (view) Author: Geraldo Xexeo (Geraldo.Xexeo) Date: 2010-07-18 01:51
The fact that in IDLE sys.stdin is a idlelib.rpc.RPCProxy  results in programs having different behavior in IDLE and in Command Line mode.

I noticed that when grading many students exercises in IDLE. Things like:

sys.stdin.readlines()

just don´t exists in IDLE, but are fully operational in Command Line mode.

In Command Line mode, sys.stdin is a file.

This is expected, as the manual (27.1) says that sys.stdin (and stdout and stderrr) are "File objects corresponding to the interpreter’s standard input"

There are also other "quirks".

I fell that is really strange that stdin has different behavior for the same program.
msg110904 - (view) Author: Tal Einat (taleinat) (Python committer) Date: 2010-07-20 14:42
I agree that the wrapping of these in IDLE should be as transparent as possible.

It would be helpful if you could specify what other "quirks" you have found regarding sys.stdin, sys.stdout and sys.stderr, preferably describing use cases where these are problematic.
History
Date User Action Args
2010-07-20 14:42:59taleinatsetnosy: + taleinat
messages: + msg110904
2010-07-18 01:51:33Geraldo.Xexeocreate