Issue 1563079: code.InteractiveConsole() and closed sys.stdout (original) (raw)

Created on 2006-09-21 18:53 by skip.montanaro, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
code.diff skip.montanaro,2006-09-27 10:46
Messages (4)
msg29905 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2006-09-21 18:53
This code raises a ValueError: import code c = code.InteractiveConsole() c.interact() import sys sys.stdout.close() because the InteractiveConsole uses raw_input() to display its prompt. I'm not sure where the correct place to fix this is. One possible way is to allow raw_input() to take optional arguments to use instead of sys.stdin and sys.stdout. Another (easier?) way to fix this problem might be to beef up InteractiveConsole.raw_input() a bit. I'm open to either option, but I think InteractiveConsole needs to continue working even if the user closes sys.stdout. This applies to the 2.4 and 2.5 branches as well as the trunk.
msg29906 - (view) Author: Skip Montanaro (skip.montanaro) * (Python triager) Date: 2006-09-27 10:46
Logged In: YES user_id=44345 Here's a plausible (I think) patch for code.InteractiveConsole.
msg84463 - (view) Author: Daniel Diniz (ajaksu2) * (Python triager) Date: 2009-03-30 02:33
Confirmed on trunk, works fine on py3k.
msg114822 - (view) Author: Mark Lawrence (BreamoreBoy) * Date: 2010-08-24 20:42
Works fine on 2.7 and py3k.
History
Date User Action Args
2022-04-11 14:56:20 admin set github: 44006
2010-08-24 20:42:51 BreamoreBoy set status: open -> closednosy: + BreamoreBoymessages: + resolution: out of date
2010-05-20 20:28:06 skip.montanaro set nosy: - skip.montanaro
2009-03-30 02:33:01 ajaksu2 set priority: normal -> lowtype: behaviorversions: + Python 2.6keywords: + patch, easynosy: + ajaksu2messages: + stage: test needed
2006-09-21 18:53:14 skip.montanaro create