[Python-bugs-list] [ python-Bugs-643571 ] Pythonwin : close() on a stdout
SourceForge.net
noreply@sourceforge.net
Wed, 09 Jul 2003 22:38:39 -0700
Bugs item #643571, was opened at 2002-11-25 09:28
Message generated for change (Comment added) made by kbk
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=643571&group_id=5470
Category: IDLE
Group: Python 2.2.2
>Status: Pending
>Resolution: Wont Fix
Priority: 5
Submitted By: Xavier BASSERY (balthus)
>Assigned to: Kurt B. Kaiser (kbk)
Summary: Pythonwin : close() on a stdout
Initial Comment:
I need to treat file objects and sys.stdout object as one.
So I can write a class that writes likewise in a file
or to standard output.
The problem came when I called the close() method of an
sys.stdout object.
I've seen that in Pythonwin, sys.stdout has such a method.
This is not the case in the standard python.
And calling it causes that :
File
"C:\Python22\lib\site-packages\Pythonwin\pywin\scintilla\document.py",
line 153, in __call__
return apply(getattr(v, self.name), (std, extra))
AttributeError: OnBraceMatch
win32ui: Exception in OnNotify() handler
I know that the right way to go is to avoid using the
close() method.
But methinks it's a bug that the method is available in
the IDE of pythonwin.
----------------------------------------------------------------------
>Comment By: Kurt B. Kaiser (kbk)
Date: 2003-07-10 00:38
Message:
Logged In: YES
user_id=149084
Closing the stdout is not very helpful, as you will see
if you try it in the interactive interpreter.
Take a look at IDLE's PyShell.py for a way to use
Pseudofiles, this may help you.
We don't deal with Pythonwin.
----------------------------------------------------------------------
Comment By: Xavier BASSERY (balthus)
Date: 2002-11-25 09:38
Message:
Logged In: YES
user_id=653276
>> sys.stdout has such a method.
>> This is not the case in the standard python
I was not completely right here, in console mode there is
the close() methode for sys.stdout object.
It's not the case in the IDLE !
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=643571&group_id=5470