[issue14576] IDLE cannot connect to subprocess - New solution

clikkeb report at bugs.python.org
Mon Apr 16 10:30:12 CEST 2012


clikkeb <clikkeb at gmail.com> added the comment:

I think that lines 207-210 of GetUserCfgDir should be modified like this:

try:
    sys.stderr.write(warn)
except (IOError, AttributeError):    # <---- 
    pass        #^^^^^^^^^^^^^^

because when you start IDLE via pythonw.exe (that sets sys.stderr to "None"),
the function call sys.stderr.write(warn) raises the following exception:

    AttributeError: 'NoneType' object has no attribute 'write'

and IDLE stops running without displaying any exception error, because that
exception is unhandled.

There is a funcion call to sys.stderr.write also at line 222, just before a
"raise SystemExit" statement, which makes ininfluent the missing 
AttributeError exception handling.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue14576>
_______________________________________


More information about the Python-bugs-list mailing list