Terry J. Reedy added the comment:

The lengths of the strings on the 3 lines are 644, 432, and 7728, as determined 
by adding 4th line to print them.  In Win10, the editor window shows.

MESSAGE_1 = '02.... <to edge of window>
MESSAGE_2 = 'Ag.... <to edge of window>
MESSAGE_1 = 

The problem is the blank after '=' on line 3.  If I put the cursor anywhere in 
the false blank, the line is filled in up to the cursor.

IDLE uses tkinter, which wraps tk.  It is known that tk Text widgets do not 
handle long lines well.  There is a previous issue (which I cannot find at the 
moment) about long lines (in Shell) making scrolling slow, Printing the third 
line in Shell, where long lines are wrapped, works.

I do not remember seeing this disappearing text problem before.  Putting the 
string without blanks on a line by itself, the limit for correct behavior (the 
beginning of the line appears when the file is freshly loaded) is 2730 chars, 
including the quotes.    I guess no one inclined to report a problem has tried 
anything longer before.

The need for such long literals in a code file is unusual, but definitely 
legitimate for testing.  On stackoverflow, I constantly urge people to develop 
programs that read and parse data by putting sample data in the code file.  (If 
not in a separate test file.) The workaround for literals over 2728 chars is to 
use Python's implicit string literal concatenation.  For instance, "s = 'a' 'b' 
'c'" results in "s == 'abc'".  Using this, you could define your third string 
thusly:

m3 = (
'<first 2000 chars>'
'<next 2000 chars>'
'<next 2000 chars>'
'<last 1728 chars>'
) # 7728 chars

IDLE's column indicator makes this easy enough.

Not wrapping longs lines in the editor is intentional.  So is not adding a 
horizontal scrollbar (not my decision).  But if adding one solves this problem, 
I will reconsider.  In the meanwhile, I will consider a new IDLE doc section 
"2.6 Tkinter limitations", which could also mention non-display of astral 
characters.

----------

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue28840>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to