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.

Title: Idle doesn't obey the new improved warnings arguements
Type: behavior Stage:
Components: IDLE, Library (Lib) Versions: Python 3.0, Python 2.6
Status: closed Resolution: accepted
Dependencies: Superseder:
Assigned To: Nosy List: amaury.forgeotdarc, gpolo, scott_daniels
Priority: normal Keywords: patch

Created on 2008-09-21 23:52 by scott_daniels, last changed 2022-04-11 14:56 by admin. This issue is now closed.

File name Uploaded Description Edit
diff_trunk scott_daniels, 2008-09-27 23:32 File contains diffs for changes described above. scott_daniels, 2008-09-27 23:33 Test for (most of) discovered issues. scott_daniels, 2008-11-23 23:32 Code and differs for Py
idle_fixwarnings.diff gpolo, 2009-08-03 15:44
Messages (10)
msg73541 - (view) Author: Scott David Daniels (scott_daniels) * Date: 2008-09-21 23:52
Idle doesn't accept the new improved warnings arguments, thus escalating
warnings to failures.  This is, I believe, the core reason that Idle was
failing on windows (warnings about deprecated set_daemon call escalated
to a failure).

Files affected: idlelib/ and idlelib/

On chasing this, it looks like the code in is masking 
IOErrors a little too broadly, so we should probably also narrow the
exception handling in

Patch coming, but not ready just yet.
msg73581 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2008-09-22 14:51
The first part was already mentioned in issue3391, but not closing this
in favor of the second part of your message.
msg73631 - (view) Author: Scott David Daniels (scott_daniels) * Date: 2008-09-23 12:45
I found that patch, but it confuses showwarning and formatwarning 
parameter changes.
msg73946 - (view) Author: Scott David Daniels (scott_daniels) * Date: 2008-09-27 23:32
OK, Issues:
    I/O errors in formatwarning will be masked and misinterpreted as
failures to write on stderr, and no output will be attempted.  

A line with of whitespace will be shown, rather than suppressed.

3) idlelib/ 
idle_show_warning did not take new args to showwarning.
& a repeat of an error much like 1.

3) idlelib/
idle_format_warning did not take new arg to formatwarning.

4) idlelib/
extended_linecache_checkcache did not pass its arg along to 
orig_checkcache.  Had to rename the element in the loop to
avoid trashing the arg.

5) idlelib/
idle_formatwarning_subproc must also follow the new protocol for 
msg73947 - (view) Author: Scott David Daniels (scott_daniels) * Date: 2008-09-27 23:33
Here is a test for the fixes provided.
msg76191 - (view) Author: Amaury Forgeot d'Arc (amaury.forgeotdarc) * (Python committer) Date: 2008-11-21 16:47
This is already corrected by r66922 (issue3391), but the patches are
different and there are some things I don't like in the present

- in idle_showwarning, the "file" argument is ignored and always
replaced by warning_stream.
- warnings.formatwarning is passed a "file" argument: this could fail,
but works only because the function is monkey-patched. But "file" is not
even used there!

The attached patch seems better, but does not apply cleanly any more.
msg76280 - (view) Author: Scott David Daniels (scott_daniels) * Date: 2008-11-23 23:32
Attached -- a zip of updates for Python 2.6 and Python 3.0
against the current source [zip has two 

For Python 2.6:
py26/diff_py26.txt  -- differ against python26-maint tree
py26/     -- Replacement file for .../Lib/idlelib/
py26/         -- Replacement file for .../Lib/idlelib/

For Python 3.0:
py30/py3k_diff.txt  -- differ against python3k tree
py30/     -- Replacement file for .../Lib/idlelib/
py30/         -- Replacement file for .../Lib/idlelib/
msg91223 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-03 15:44
This looks good Scott, I'm just attaching the .diff here with real minor
changes and will be applying if no one is against it.
msg91550 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-14 14:03
Committed on r74447, will merge into py3k.
msg91554 - (view) Author: Guilherme Polo (gpolo) * (Python committer) Date: 2009-08-14 15:08
> Committed on r74447, will merge into py3k.

py3k: r74450
Date User Action Args
2022-04-11 14:56:39adminsetgithub: 48176
2009-08-14 15:08:03gpolosetmessages: + msg91554
2009-08-14 14:03:46gpolosetstatus: open -> closed
resolution: accepted
messages: + msg91550
2009-08-03 15:44:35gpolosetfiles: + idle_fixwarnings.diff
keywords: + patch
messages: + msg91223
2008-11-23 23:32:22scott_danielssetfiles: +
messages: + msg76280
2008-11-21 16:47:19amaury.forgeotdarcsetnosy: + amaury.forgeotdarc
messages: + msg76191
2008-09-27 23:33:41scott_danielssetfiles: +
messages: + msg73947
2008-09-27 23:32:04scott_danielssetfiles: + diff_trunk
messages: + msg73946
components: + IDLE, Library (Lib)
2008-09-23 12:45:54scott_danielssetmessages: + msg73631
2008-09-22 14:51:06gpolosetnosy: + gpolo
messages: + msg73581
2008-09-21 23:52:15scott_danielscreate