[ python-Bugs-1563079 ] code.InteractiveConsole() and closed sys.stdout
SourceForge.net
noreply at sourceforge.net
Wed Sep 27 12:46:37 CEST 2006
Bugs item #1563079, was opened at 2006-09-21 13:53
Message generated for change (Comment added) made by montanaro
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1563079&group_id=5470
Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Skip Montanaro (montanaro)
Assigned to: Nobody/Anonymous (nobody)
Summary: code.InteractiveConsole() and closed sys.stdout
Initial Comment:
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.
----------------------------------------------------------------------
>Comment By: Skip Montanaro (montanaro)
Date: 2006-09-27 05:46
Message:
Logged In: YES
user_id=44345
Here's a plausible (I think) patch for code.InteractiveConsole.
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1563079&group_id=5470
More information about the Python-bugs-list
mailing list