[issue1442493] IDLE shell window gets very slow when displaying long lines

Terry J. Reedy report at bugs.python.org
Mon Aug 15 13:49:56 EDT 2016


Terry J. Reedy added the comment:

manual_wrap.patch patches OutputWindow (2.7) to arbitrarily and blindly wrap at 80 chars.  OutputWindow is used directly for grep output, as well as the base for PyShell.  The grep output format is currently "'{}: {}: {}'.format(filepath, linenum, codeline)".  Output lines are typically (for me) > 80 chars and I would not want a fixed-column wrap.  With a right click, one can go to the file and line and this should not be disabled.  Ditto for tracebacks, where code lines are pre-wrapped (with an added indent) onto a second physical line. Wrap at 80 would wrap lines that were originally 80 before having the traceback indent added.  Autowrap should only be applied to user stdout sent to Shell.

Perhaps wrapping should have a window (80-100?) within which we look for a space.  I have about concluded that we should add horizontal scrollbars anyway, since Python and IDLE output lines longer than 80 chars.

To evaluate the patch further, I want to look at how the socket stream is being read.

As long as we are modifying user output before inserting into the text widget, astral chars should be expanded into their unicode escapes. (There are multiple issue for astral chars.  Tk 8.7 reportedly will handle them.) The replacement text should be tagged and colored as such.  Wrapping should not break replacements.  The same could be done for control chars to make them visible.  (Astral char handling is needed for paths also!).

----------

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


More information about the Python-bugs-list mailing list