[Python-bugs-list] [ python-Bugs-643571 ] Pythonwin : close() on a stdout

noreply@sourceforge.net noreply@sourceforge.net
Mon, 25 Nov 2002 06:38:15 -0800


Bugs item #643571, was opened at 2002-11-25 15:28
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=643571&group_id=5470

Category: Extension Modules
Group: Python 2.2.2
Status: Open
Resolution: None
Priority: 5
Submitted By: Xavier BASSERY (balthus)
Assigned to: Nobody/Anonymous (nobody)
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: Xavier BASSERY (balthus)
Date: 2002-11-25 15: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