This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author terry.reedy
Recipients Arfrever, brett.cannon, kbk, python-dev, r.david.murray, roger.serwy, terry.reedy, vinay.sajip, vstinner
Date 2013-06-27.01:15:30
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1372295731.58.0.482831196216.issue18081@psf.upfronthosting.co.za>
In-reply-to
Content
Here is a patch that looks much bigger than it really is. Idle was written before the warnings module, so the warnings system was conditioned on a successful warnings import. The test is no longer needed, and neither Vinay nor Victor repeated the test at the new location for the warnings.showwarning patch, within PyShell.main and run.main. I just deleted the test and dedented the indented blocks, which were, except for three lines, otherwise unchanged.

For run.py, I copied warnings.showwarnings and changed it to call idle_formatwarnings_subproc instead of (patched) warnings.formatwarnings. I then put the replacement of warnings.showwarnings in main after the sanity checks.

For PyShell.py, I made a similar change in showwarnings and the warnings.showwarnings replacement. I also added AttributeError to the print exception. At least on Windows, warning_stream = sys.__stderr__  is None when Idle is started normally, from an icon. But otherwise changing Idle to stop expecting a writable console is another issue.
History
Date User Action Args
2013-06-27 01:15:31terry.reedysetrecipients: + terry.reedy, brett.cannon, kbk, vinay.sajip, vstinner, roger.serwy, Arfrever, r.david.murray, python-dev
2013-06-27 01:15:31terry.reedysetmessageid: <1372295731.58.0.482831196216.issue18081@psf.upfronthosting.co.za>
2013-06-27 01:15:31terry.reedylinkissue18081 messages
2013-06-27 01:15:31terry.reedycreate