[Idle-dev] (IOError: [Errno 9] Bad file descriptor) in IDLE for Python 2.3.4 (final)

Danny Yoo dyoo at hkn.eecs.berkeley.edu
Mon Jul 5 02:55:25 CEST 2004


> >   File "C:\PROGRA~1\lib\idlelib\ScriptBinding.py", line 96, in checksyntax
> >     return compile(source, filename, "exec")
> >   File "C:\PROGRA~1\lib\warnings.py", line 116, in warn_explicit
> >     showwarning(message, category, filename, lineno)
> >   File "C:\PROGRA~1\lib\idlelib\PyShell.py", line 55, in idle_showwarning
> >     file.write(warnings.formatwarning(message, category, filename, lineno))
> > IOError: [Errno 9] Bad file descriptor
>
> This problem has two levels.  First, the SyntaxWarning (you assigned to
> a global before declaring it) was going to __stderr__ and not to the
> shell.  I checked in a fix to send SyntaxWarning to the shell and also
> implemented the warnings.py policy of skipping the warning if the output
> stream was bogus. (Introduced at warnings.py 1.17 11Sep02)
>
> The second level is, why is your sys.__stderr__ call returning a bad
> file descriptor?  Since you saw the error, you must be using a dos box,
> but usually this problem shows up only when using pythonw and only when
> trying to write more than 4096 bytes (which is not the case for this
> warning).

Hi Kurt,

But what happens if that program is run repeatedly in the same IDLE shell?
Eventually, all that warning text should accumulate up to 4096 bytes.

Dragonfirebane originally posted a problem report on Tutor:

    http://mail.python.org/pipermail/tutor/2004-June/030196.html

and he mentioned that the problem occurs after a while.  It may not happen
immediately, but I'd guess that after doing 'Run Script' a few times, the
length of the accumulated warnings might add up.  Does that sound
reasonable?




More information about the IDLE-dev mailing list