msg148513 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2011-11-28 19:56 |
Two instances of ColorDelegator are in the percolator chain. This is a regression from 2.x. The problem can be found in __init__ of EditorWindow in EditorWindow.py. Calling "io.loadfile" eventually calls "filename_change_hook" (See IOBinding.py's "set_filename"). The "filename_change_hook" calls "ResetColorizer" which brings up an instance of ColorDelegator. Then, the self.color reference is overwritten by a new ColorDelegator instance and added to the percolator chain. The attached patch fixes the problem. |
|
|
msg148864 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2011-12-05 07:35 |
I attached a better patch that preserves the goals of the original code while not creating two color delegators. I traced down when the regression occurred (2007-09-06): (a4bd8a4805a8) 1. Fail gracefully if the file fails to decode when loaded. This patch (2008-02-16) modified parts of the last patch, as well adds "ResetColorizer" to the filename_change_hook. (7c4c46342137) Merged revisions 60481,60485,60489-60492,60494-60496,60498-60499,60501-60503,605 |
|
|
msg151278 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2012-01-15 05:51 |
There was another regression introduced by (a4bd8a4805a8). IDLE 3 no longer allows for editing of new files from the command line. For example: idle -e /tmp/newfile.py will momentarily flash an editor window before it is closed. This is due to "good_load" not being set. What's worse is that the IDLE process will continue running without having any visible windows open. The rev2 patch removes the "good_load" flag and fixes the ColorDelegator issue. I understand the purpose of the original code is to avoid displaying a blank editor in case of a decode error. The rev2 patch reintroduces this behavior. In my opinion, that behavior is not a serious problem. |
|
|
msg151280 - (view) |
Author: Terry J. Reedy (terry.reedy) *  |
Date: 2012-01-15 06:52 |
If you are saying that it is better to open a blank window than to not open a filled window, I agree. |
|
|
msg187397 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2013-04-20 02:32 |
I will split the "good_load" flag bug into its own issue. While addressing a bug in #5492, another doubled-up ColorDelegator problem appeared, tracing back to #1586. The dual_delagators patch removes the code which loads the extra color delegators as well as ensures that ResetColorizer loads a color delegator since ispythonsource() now always returns True in a PyShell instance. |
|
|
msg188486 - (view) |
Author: Roundup Robot (python-dev)  |
Date: 2013-05-06 03:15 |
New changeset fef7f212fe76 by Roger Serwy in branch '3.3': #13495: Avoid loading the color delegator twice in IDLE. http://hg.python.org/cpython/rev/fef7f212fe76 New changeset 588fcf36c975 by Roger Serwy in branch 'default': #13495: merge with 3.3. http://hg.python.org/cpython/rev/588fcf36c975 |
|
|
msg188487 - (view) |
Author: Roger Serwy (roger.serwy) *  |
Date: 2013-05-06 03:16 |
I'm closing this issue as fixed. |
|
|