[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests:  -11811

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
resolution:  -> fixed
stage: patch review -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests:  -11808

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
pull_requests:  -11809

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread miss-islington


miss-islington  added the comment:


New changeset 3fcfef357e64a25afd52ec6a0d1b5284cb162203 by Miss Islington (bot) 
in branch '3.7':
bpo-35833: Revise IDLE doc for control codes sent to Shell. (GH-11799)
https://github.com/python/cpython/commit/3fcfef357e64a25afd52ec6a0d1b5284cb162203


--
nosy: +miss-islington

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Terry J. Reedy  added the comment:


New changeset 8a03ff2ff4db973c9fe152561f1796e72cb71132 by Terry Jan Reedy in 
branch 'master':
bpo-35833: Revise IDLE doc for control codes sent to Shell. (GH-11799)
https://github.com/python/cpython/commit/8a03ff2ff4db973c9fe152561f1796e72cb71132


--
pull_requests: +11810

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread miss-islington


Change by miss-islington :


--
pull_requests: +11810, 11811

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch, patch
pull_requests: +11807, 11808
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch, patch, patch
pull_requests: +11807, 11808, 11809
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-02-08 Thread Terry J. Reedy


Change by Terry J. Reedy :


--
keywords: +patch
pull_requests: +11807
stage: needs patch -> patch review

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-01-26 Thread Terry J. Reedy


Terry J. Reedy  added the comment:

Martin, your suspicion is correct, as verified by selecting and copying the 
string and pasting into code between quotes.  I strongly suspect that tk just 
sends the string as is to the OS graphics system insert text function, that the 
latter decides what to display.  I ran
  for i in range(1,33): print(f'<{chr(i)}>')
on Windows console, Windows IDLE, and Mac IDLE (omitting '1' crashes on Mac) 
and there are multiple inconsistencies.  I believe tcl/tk only documents \t and 
\n because those are the only two control chars whose behavior is consistent 
across graphics systems.  Thanks for digging up the previous issue.  I would 
close as a duplicate if I did not see a need for doc revision.

--
nosy: +martin.panter

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue35833] IDLE: revise doc for control chars sent to Shell

2019-01-26 Thread Terry J. Reedy

Terry J. Reedy  added the comment:

Example code for the tracker should not use 3rd-party modules unless essential. 
 It should be reduced to the minimum testcase needed to show the behavior.  In 
this case, "print('a\b')", resulting, on Windows 10, in "a", is enough. (On 
macOS Mohave, the result is just 'a'.) These results are not a bug. The IDLE 
chapter of the doc, viewable with Help => IDLE Doc, has a section 'User output 
in Shell', added for 3.6.8 and 3.7.2, that explains.  The full relevant text 
with the key line Martin posted is

"When a program outputs text, the result is determined by the corresponding 
output device.  When IDLE executes user code, sys.stdout and sys.stderr are 
connected to the display area of IDLE’s Shell.  Some of its features are 
inherited from the underlying Tk Text widget.  Others are programmed additions. 
 Where it matters, Shell is designed for development rather than production 
runs. 
...
Text widgets display a subset of Unicode, the Basic Multilingual Plane (BMP). 
Which characters get a proper glyph instead of a replacement box depends on the 
operating system and installed fonts.  Newline characters cause following text 
to appear on a new line, but other control characters are either replaced with 
a box or deleted.  However, repr(), which is used for interactive echo of 
expression values, replaces control characters, some BMP codepoints, and all 
non-BMP characters with escape codes before they are output."

In reviewing this and doing more experiments, I realized that this needs 
revision. A. tabs jump to the next 8-char tabstop.  B. Display replacements for 
control chars can include spaces and other things.  C. Display replacements 
depend on the operating system (as noted above) and possibly the font. D. 
Display replacements only occur when the string is displayed, not when stored 
in the text widget.  Selecting and copying a string on the screen copies what 
is stored in the widget, not what is displayed on the screen.  E. Trying to 
insert non-BMP characters ('\U000n') in a text widget is an error.  
(Preventing this even when a user implicitly requests is a separate issue.)  F. 
Printing null and return characters may cause problems.  Null (\0, \x00) hands 
IDLE on Mac.  Return (\r, \x0D) is ignored by tk but interpreted and converted 
to \n when pasted into code.

I want to add a code block example that illustrate some of these points.

>>> s = 'abc\t\a<\x02><\r>\b'
>>> len(s)
12
>>> s
'abc\t\x07<\x02><\r>\x08'  # This is repr(s).
>>> print(s)  # In IDLE, inserts s into text widget.
# Visible result varies; try it.

PS: On hard-copy terminals, where control characters originated, \b only means 
'Move the print position back a character.'  On 'soft-copy' terminals and 
consoles, it may or may not also mean 'erase the previous character'.

--
nosy:  -martin.panter
stage:  -> needs patch
title: Backspace not working -> IDLE: revise doc for control chars sent to Shell
versions: +Python 3.8

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com