Skip to content

Commit 1b4a9c7

Browse files
authored
bpo-42225: IDLE - document two unix-related problems. (python#25078)
1. Bad IP masquerade rules can prevent startup. 2. X cannot handle some complex colored chars.
1 parent b775106 commit 1b4a9c7

File tree

3 files changed

+39
-9
lines changed

3 files changed

+39
-9
lines changed

Doc/library/idle.rst

Lines changed: 17 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -670,8 +670,16 @@ IDLE uses a socket to communicate between the IDLE GUI process and the user
670670
code execution process. A connection must be established whenever the Shell
671671
starts or restarts. (The latter is indicated by a divider line that says
672672
'RESTART'). If the user process fails to connect to the GUI process, it
673-
displays a ``Tk`` error box with a 'cannot connect' message that directs the
674-
user here. It then exits.
673+
usually displays a ``Tk`` error box with a 'cannot connect' message
674+
that directs the user here. It then exits.
675+
676+
One specific connection failure on Unix systems results from
677+
misconfigured masquerading rules somewhere in a system's network setup.
678+
When IDLE is started from a terminal, one will see a message starting
679+
with ``** Invalid host:``.
680+
The valid value is ``127.0.0.1 (idlelib.rpc.LOCALHOST)``.
681+
One can diagnose with ``tcpconnect -irv 127.0.0.1 6543`` in one
682+
terminal window and ``tcplisten <same args>`` in another.
675683

676684
A common cause of failure is a user-written file with the same name as a
677685
standard library module, such as *random.py* and *tkinter.py*. When such a
@@ -709,6 +717,13 @@ If IDLE quits with no message, and it was not started from a console, try
709717
starting it from a console or terminal (``python -m idlelib``) and see if
710718
this results in an error message.
711719

720+
On Unix-based systems with tcl/tk older than ``8.6.11`` (see
721+
``About IDLE``) certain characters of certain fonts can cause
722+
a tk failure with a message to the terminal. This can happen either
723+
if one starts IDLE to edit a file with such a character or later
724+
when entering such a character. If one cannot upgrade tcl/tk,
725+
then re-configure IDLE to use a font that works better.
726+
712727
Running user code
713728
^^^^^^^^^^^^^^^^^
714729

Lib/idlelib/help.html

Lines changed: 20 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@
55
<head>
66
<meta charset="utf-8" />
77
<meta name="viewport" content="width=device-width, initial-scale=1.0" />
8-
<title>IDLE &#8212; Python 3.10.0a5 documentation</title>
8+
<title>IDLE &#8212; Python 3.10.0a6 documentation</title>
99
<link rel="stylesheet" href="../_static/pydoctheme.css" type="text/css" />
1010
<link rel="stylesheet" href="../_static/pygments.css" type="text/css" />
1111

@@ -18,7 +18,7 @@
1818
<script src="../_static/sidebar.js"></script>
1919

2020
<link rel="search" type="application/opensearchdescription+xml"
21-
title="Search within Python 3.10.0a5 documentation"
21+
title="Search within Python 3.10.0a6 documentation"
2222
href="../_static/opensearch.xml"/>
2323
<link rel="author" title="About these documents" href="../about.html" />
2424
<link rel="index" title="Index" href="../genindex.html" />
@@ -71,7 +71,7 @@ <h3>Navigation</h3>
7171

7272

7373
<li id="cpython-language-and-version">
74-
<a href="../index.html">3.10.0a5 Documentation</a> &#187;
74+
<a href="../index.html">3.10.0a6 Documentation</a> &#187;
7575
</li>
7676

7777
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
@@ -632,8 +632,15 @@ <h3>Startup failure<a class="headerlink" href="#startup-failure" title="Permalin
632632
code execution process. A connection must be established whenever the Shell
633633
starts or restarts. (The latter is indicated by a divider line that says
634634
‘RESTART’). If the user process fails to connect to the GUI process, it
635-
displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message that directs the
636-
user here. It then exits.</p>
635+
usually displays a <code class="docutils literal notranslate"><span class="pre">Tk</span></code> error box with a ‘cannot connect’ message
636+
that directs the user here. It then exits.</p>
637+
<p>One specific connection failure on Unix systems results from
638+
misconfigured masquerading rules somewhere in a system’s network setup.
639+
When IDLE is started from a terminal, one will see a message starting
640+
with <code class="docutils literal notranslate"><span class="pre">**</span> <span class="pre">Invalid</span> <span class="pre">host:</span></code>.
641+
The valid value is <code class="docutils literal notranslate"><span class="pre">127.0.0.1</span> <span class="pre">(idlelib.rpc.LOCALHOST)</span></code>.
642+
One can diagnose with <code class="docutils literal notranslate"><span class="pre">tcpconnect</span> <span class="pre">-irv</span> <span class="pre">127.0.0.1</span> <span class="pre">6543</span></code> in one
643+
terminal window and <code class="docutils literal notranslate"><span class="pre">tcplisten</span> <span class="pre">&lt;same</span> <span class="pre">args&gt;</span></code> in another.</p>
637644
<p>A common cause of failure is a user-written file with the same name as a
638645
standard library module, such as <em>random.py</em> and <em>tkinter.py</em>. When such a
639646
file is located in the same directory as a file that is about to be run,
@@ -664,6 +671,12 @@ <h3>Startup failure<a class="headerlink" href="#startup-failure" title="Permalin
664671
<p>If IDLE quits with no message, and it was not started from a console, try
665672
starting it from a console or terminal (<code class="docutils literal notranslate"><span class="pre">python</span> <span class="pre">-m</span> <span class="pre">idlelib</span></code>) and see if
666673
this results in an error message.</p>
674+
<p>On Unix-based systems with tcl/tk older than <code class="docutils literal notranslate"><span class="pre">8.6.11</span></code> (see
675+
<code class="docutils literal notranslate"><span class="pre">About</span> <span class="pre">IDLE</span></code>) certain characters of certain fonts can cause
676+
a tk failure with a message to the terminal. This can happen either
677+
if one starts IDLE to edit a file with such a character or later
678+
when entering such a character. If one cannot upgrade tcl/tk,
679+
then re-configure IDLE to use a font that works better.</p>
667680
</div>
668681
<div class="section" id="running-user-code">
669682
<h3>Running user code<a class="headerlink" href="#running-user-code" title="Permalink to this headline"></a></h3>
@@ -958,7 +971,7 @@ <h3>Navigation</h3>
958971

959972

960973
<li id="cpython-language-and-version">
961-
<a href="../index.html">3.10.0a5 Documentation</a> &#187;
974+
<a href="../index.html">3.10.0a6 Documentation</a> &#187;
962975
</li>
963976

964977
<li class="nav-item nav-item-1"><a href="index.html" >The Python Standard Library</a> &#187;</li>
@@ -990,7 +1003,7 @@ <h3>Navigation</h3>
9901003
<br />
9911004
<br />
9921005

993-
Last updated on Feb 23, 2021.
1006+
Last updated on Mar 29, 2021.
9941007
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
9951008
<br />
9961009

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,2 @@
1+
Document that IDLE can fail on Unix either from misconfigured IP masquerage
2+
rules or failure displaying complex colored (non-ascii) characters.

0 commit comments

Comments
 (0)