[Python-checkins] bpo-33000: Document that IDLE's shell has no line limit. (GH-10373)

Miss Islington (bot) webhook-mailer at python.org
Wed Nov 7 00:06:58 EST 2018


https://github.com/python/cpython/commit/2b2a8c130ceb47842cfbd0c725b5b6599b26cf27
commit: 2b2a8c130ceb47842cfbd0c725b5b6599b26cf27
branch: 3.7
author: Miss Islington (bot) <31488909+miss-islington at users.noreply.github.com>
committer: GitHub <noreply at github.com>
date: 2018-11-06T21:06:54-08:00
summary:

bpo-33000: Document that IDLE's shell has no line limit. (GH-10373)


A program that runs indefinitely can overfill memory.
(cherry picked from commit 76cd0c30d60961d1a10e2673834a455d2b51f695)

Co-authored-by: Terry Jan Reedy <tjreedy at udel.edu>

files:
A Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst
M Doc/library/idle.rst
M Lib/idlelib/help.html

diff --git a/Doc/library/idle.rst b/Doc/library/idle.rst
index fa58e2d59421..f353fbc86127 100644
--- a/Doc/library/idle.rst
+++ b/Doc/library/idle.rst
@@ -671,15 +671,23 @@ 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.
+are programmed additions.  Where it matters, Shell is designed for development
+rather than production runs.
+
+For instance, Shell never throws away output.  A program that sends unlimited
+output to Shell will eventually fill memory, resulting in a memory error.
+In contrast, some system text windows only keep the last n lines of output.
+A Windows console, for instance, keeps a user-settable 1 to 9999 lines,
+with 300 the default.
 
 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 replaced
-with a box.  But note that the ``repr()`` function, which is used for
-interactive echo of expression values, replaces control characters
-with escape codes before they are output.
+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.
 
 Normal and error output are generally kept separate (on separate lines)
 from code input and each other.  They each get different highlight colors.
diff --git a/Lib/idlelib/help.html b/Lib/idlelib/help.html
index 83bd4a1b91df..f0b42151f359 100644
--- a/Lib/idlelib/help.html
+++ b/Lib/idlelib/help.html
@@ -648,14 +648,21 @@ <h3>User output in Shell<a class="headerlink" href="#user-output-in-shell" title
 corresponding output device.  When IDLE executes user code, <code class="docutils literal notranslate"><span class="pre">sys.stdout</span></code>
 and <code class="docutils literal notranslate"><span class="pre">sys.stderr</span></code> 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.</p>
+are programmed additions.  Where it matters, Shell is designed for development
+rather than production runs.</p>
+<p>For instance, Shell never throws away output.  A program that sends unlimited
+output to Shell will eventually fill memory, resulting in a memory error.
+In contrast, some system text windows only keep the last n lines of output.
+A Windows console, for instance, keeps a user-settable 1 to 9999 lines,
+with 300 the default.</p>
 <p>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 replaced
-with a box.  But note that the <code class="docutils literal notranslate"><span class="pre">repr()</span></code> function, which is used for
-interactive echo of expression values, replaces control characters
-with escape codes before they are output.</p>
+text to appear on a new line, but other control characters are either
+replaced with a box or deleted.  However, <code class="docutils literal notranslate"><span class="pre">repr()</span></code>, 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.</p>
 <p>Normal and error output are generally kept separate (on separate lines)
 from code input and each other.  They each get different highlight colors.</p>
 <p>For SyntaxError tracebacks, the normal ‘^’ marking where the error was
diff --git a/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst
new file mode 100644
index 000000000000..c6ba9e4669d5
--- /dev/null
+++ b/Misc/NEWS.d/next/IDLE/2018-11-06-23-10-54.bpo-33000.pQasCt.rst
@@ -0,0 +1,2 @@
+Document that IDLE's shell has no line limit. A program that runs
+indefinitely can overfill memory.



More information about the Python-checkins mailing list