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 piotr.sk, terry.reedy
Date 2016-11-30.18:26:13
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1480530374.13.0.3843557259.issue28840@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2016-11-30 18:26:14terry.reedysetrecipients: + terry.reedy, piotr.sk
2016-11-30 18:26:14terry.reedysetmessageid: <1480530374.13.0.3843557259.issue28840@psf.upfronthosting.co.za>
2016-11-30 18:26:14terry.reedylinkissue28840 messages
2016-11-30 18:26:13terry.reedycreate