Issue 2665: On Windows, sys.stderr does not contain a valid file when running without a console.
It seems to work, but will fail at the first flush.

This causes IDLE to silently crash when too many warnings are printed.

Backport of r62448.
2 files changed