Skip to content

Commit 868fb9e

Browse files
committed
Merge remote-tracking branch 'upstream/3.11' into 3.11
2 parents 19eed66 + 6dffb5f commit 868fb9e

File tree

6 files changed

+84
-38
lines changed

6 files changed

+84
-38
lines changed

Doc/library/idle.rst

Lines changed: 25 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -61,17 +61,17 @@ New File
6161
Open...
6262
Open an existing file with an Open dialog.
6363

64-
Recent Files
65-
Open a list of recent files. Click one to open it.
66-
6764
Open Module...
6865
Open an existing module (searches sys.path).
6966

67+
Recent Files
68+
Open a list of recent files. Click one to open it.
69+
7070
.. index::
71-
single: Class browser
71+
single: Module browser
7272
single: Path browser
7373

74-
Class Browser
74+
Module Browser
7575
Show functions, classes, and methods in the current Editor file in a
7676
tree structure. In the shell, open a module first.
7777

@@ -89,7 +89,7 @@ Save As...
8989
Save the current window with a Save As dialog. The file saved becomes the
9090
new associated file for the window. (If your file namager is set to hide
9191
extensions, the current extension will be omitted in the file name box.
92-
If the new filename has no '.', '.py' and .'txt' will be added for Python
92+
If the new filename has no '.', '.py' and '.txt' will be added for Python
9393
and text files, except that on macOS Aqua,'.py' is added for all files.)
9494

9595
Save Copy As...
@@ -117,6 +117,9 @@ Undo
117117
Redo
118118
Redo the last undone change to the current window.
119119

120+
Select All
121+
Select the entire contents of the current window.
122+
120123
Cut
121124
Copy selection into the system-wide clipboard; then delete the selection.
122125

@@ -128,9 +131,6 @@ Paste
128131

129132
The clipboard functions are also available in context menus.
130133

131-
Select All
132-
Select the entire contents of the current window.
133-
134134
Find...
135135
Open a search dialog with many options
136136

@@ -159,19 +159,24 @@ Expand Word
159159
Expand a prefix you have typed to match a full word in the same window;
160160
repeat to get a different expansion.
161161

162-
Show call tip
162+
Show Call Tip
163163
After an unclosed parenthesis for a function, open a small window with
164164
function parameter hints. See :ref:`Calltips <calltips>` in the
165165
Editing and navigation section below.
166166

167-
Show surrounding parens
167+
Show Surrounding Parens
168168
Highlight the surrounding parenthesis.
169169

170170
.. _format-menu:
171171

172172
Format menu (Editor window only)
173173
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
174174

175+
Format Paragraph
176+
Reformat the current blank-line-delimited paragraph in comment block or
177+
multiline string or selected line in a string. All lines in the
178+
paragraph will be formatted to less than N columns, where N defaults to 72.
179+
175180
Indent Region
176181
Shift selected lines right by the indent width (default 4 spaces).
177182

@@ -198,12 +203,7 @@ New Indent Width
198203
Open a dialog to change indent width. The accepted default by the Python
199204
community is 4 spaces.
200205

201-
Format Paragraph
202-
Reformat the current blank-line-delimited paragraph in comment block or
203-
multiline string or selected line in a string. All lines in the
204-
paragraph will be formatted to less than N columns, where N defaults to 72.
205-
206-
Strip trailing whitespace
206+
Strip Trailing Chitespace
207207
Remove trailing space and other whitespace characters after the last
208208
non-whitespace character of a line by applying str.rstrip to each line,
209209
including lines within multiline strings. Except for Shell windows,
@@ -474,6 +474,14 @@ are restricted to four spaces due to Tcl/Tk limitations.
474474
See also the indent/dedent region commands on the
475475
:ref:`Format menu <format-menu>`.
476476

477+
Search and Replace
478+
^^^^^^^^^^^^^^^^^^
479+
480+
Any selection becomes a search target. However, only selections within
481+
a line work because searches are only performed within lines with the
482+
terminal newline removed. If ``[x] Regular expresion`` is checked, the
483+
target is interpreted according to the Python re module.
484+
477485
.. _completions:
478486

479487
Completions

Doc/using/mac.rst

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -17,15 +17,16 @@ the IDE and the Package Manager that are worth pointing out.
1717
Getting and Installing MacPython
1818
================================
1919

20-
macOS since version 10.8 comes with Python 2.7 pre-installed by Apple. If you wish, you
21-
are invited to install the most recent version of Python 3 from the Python
20+
macOS used to come with Python 2.7 pre-installed between versions
21+
10.8 and `12.3 <https://developer.apple.com/documentation/macos-release-notes/macos-12_3-release-notes#Python>`_.
22+
You are invited to install the most recent version of Python 3 from the Python
2223
website (https://www.python.org). A current "universal binary" build of Python,
2324
which runs natively on the Mac's new Intel and legacy PPC CPU's, is available
2425
there.
2526

2627
What you get after installing is a number of things:
2728

28-
* A :file:`Python 3.9` folder in your :file:`Applications` folder. In here
29+
* A :file:`Python 3.12` folder in your :file:`Applications` folder. In here
2930
you find IDLE, the development environment that is a standard part of official
3031
Python distributions; and PythonLauncher, which handles double-clicking Python
3132
scripts from the Finder.

Lib/idlelib/README.txt

Lines changed: 23 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -243,8 +243,8 @@ OTHER TOPICS
243243

244244
Generally use PEP 8.
245245

246-
import
247-
------
246+
import statements
247+
-----------------
248248
Put imports at the top, unless there is a good reason otherwise.
249249
PEP 8 says to group stdlib, 3rd-party dependencies, and package imports.
250250
For idlelib, the groups are general stdlib, tkinter, and idlelib.
@@ -259,3 +259,24 @@ htest function def or "if __name__ == '__main__'" clause.
259259
Within module imports like "from idlelib.mod import class" may cause
260260
circular imports to deadlock. Even without this, circular imports may
261261
require at least one of the imports to be delayed until a function call.
262+
263+
What's New entries
264+
------------------
265+
266+
Repository directory Doc/whatsnew/ has a file 3.n.rst for each 3.n
267+
Python version. For the first entry in each file, add subsection
268+
'IDLE and idlelib', in alphabetical position, to the 'Improved Modules'
269+
section. For the rest of cpython, entries to 3.(n+1).rst begin with
270+
the release of 3.n.0b1. For IDLE, entries for features backported from
271+
'main' to '3.n' during its beta period do not got in 3.(n+1).rst. The
272+
latter usually gets its first entry during the 3.n.0 candidate period
273+
or after the 3.n.0 release.
274+
275+
When, as per PEP 434, feature changes are backported, entries are placed
276+
in the 3.n.rst file *in the main branch* for each Python version n that
277+
gets the backport. (Note: the format of entries have varied between
278+
versions.) Add a line "New in 3.n maintenance releases." before the
279+
first back-ported feature after 3.n.0 is released. Since each older
280+
version file gets a different number of backports, it is easiest to
281+
make a separate PR for each file and label it with the backports
282+
needed.

Lib/idlelib/help.html

Lines changed: 27 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -91,6 +91,7 @@ <h3><a href="../contents.html">Table of Contents</a></h3>
9191
<li><a class="reference internal" href="#editor-windows">Editor windows</a></li>
9292
<li><a class="reference internal" href="#key-bindings">Key bindings</a></li>
9393
<li><a class="reference internal" href="#automatic-indentation">Automatic indentation</a></li>
94+
<li><a class="reference internal" href="#search-and-replace">Search and Replace</a></li>
9495
<li><a class="reference internal" href="#completions">Completions</a></li>
9596
<li><a class="reference internal" href="#calltips">Calltips</a></li>
9697
<li><a class="reference internal" href="#code-context">Code Context</a></li>
@@ -237,13 +238,13 @@ <h3>File menu (Shell and Editor)<a class="headerlink" href="#file-menu-shell-and
237238
</dd>
238239
<dt>Open…</dt><dd><p>Open an existing file with an Open dialog.</p>
239240
</dd>
240-
<dt>Recent Files</dt><dd><p>Open a list of recent files. Click one to open it.</p>
241-
</dd>
242241
<dt>Open Module…</dt><dd><p>Open an existing module (searches sys.path).</p>
243242
</dd>
243+
<dt>Recent Files</dt><dd><p>Open a list of recent files. Click one to open it.</p>
244+
</dd>
244245
</dl>
245246
<dl class="simple" id="index-1">
246-
<dt>Class Browser</dt><dd><p>Show functions, classes, and methods in the current Editor file in a
247+
<dt>Module Browser</dt><dd><p>Show functions, classes, and methods in the current Editor file in a
247248
tree structure. In the shell, open a module first.</p>
248249
</dd>
249250
<dt>Path Browser</dt><dd><p>Show sys.path directories, modules, functions, classes and methods in a
@@ -255,10 +256,13 @@ <h3>File menu (Shell and Editor)<a class="headerlink" href="#file-menu-shell-and
255256
do Save As instead.</p>
256257
</dd>
257258
<dt>Save As…</dt><dd><p>Save the current window with a Save As dialog. The file saved becomes the
258-
new associated file for the window.</p>
259+
new associated file for the window. (If your file namager is set to hide
260+
extensions, the current extension will be omitted in the file name box.
261+
If the new filename has no ‘.’, ‘.py’ and ‘.txt’ will be added for Python
262+
and text files, except that on macOS Aqua,’.py’ is added for all files.)</p>
259263
</dd>
260264
<dt>Save Copy As…</dt><dd><p>Save the current window to different file without changing the associated
261-
file.</p>
265+
file. (See Save As note above about filename extensions.)</p>
262266
</dd>
263267
<dt>Print Window</dt><dd><p>Print the current window to the default printer.</p>
264268
</dd>
@@ -278,6 +282,8 @@ <h3>Edit menu (Shell and Editor)<a class="headerlink" href="#edit-menu-shell-and
278282
</dd>
279283
<dt>Redo</dt><dd><p>Redo the last undone change to the current window.</p>
280284
</dd>
285+
<dt>Select All</dt><dd><p>Select the entire contents of the current window.</p>
286+
</dd>
281287
<dt>Cut</dt><dd><p>Copy selection into the system-wide clipboard; then delete the selection.</p>
282288
</dd>
283289
<dt>Copy</dt><dd><p>Copy selection into the system-wide clipboard.</p>
@@ -287,8 +293,6 @@ <h3>Edit menu (Shell and Editor)<a class="headerlink" href="#edit-menu-shell-and
287293
</dl>
288294
<p>The clipboard functions are also available in context menus.</p>
289295
<dl class="simple">
290-
<dt>Select All</dt><dd><p>Select the entire contents of the current window.</p>
291-
</dd>
292296
<dt>Find…</dt><dd><p>Open a search dialog with many options</p>
293297
</dd>
294298
<dt>Find Again</dt><dd><p>Repeat the last search, if there is one.</p>
@@ -309,17 +313,21 @@ <h3>Edit menu (Shell and Editor)<a class="headerlink" href="#edit-menu-shell-and
309313
<dt>Expand Word</dt><dd><p>Expand a prefix you have typed to match a full word in the same window;
310314
repeat to get a different expansion.</p>
311315
</dd>
312-
<dt>Show call tip</dt><dd><p>After an unclosed parenthesis for a function, open a small window with
316+
<dt>Show Call Tip</dt><dd><p>After an unclosed parenthesis for a function, open a small window with
313317
function parameter hints. See <a class="reference internal" href="#calltips"><span class="std std-ref">Calltips</span></a> in the
314318
Editing and navigation section below.</p>
315319
</dd>
316-
<dt>Show surrounding parens</dt><dd><p>Highlight the surrounding parenthesis.</p>
320+
<dt>Show Surrounding Parens</dt><dd><p>Highlight the surrounding parenthesis.</p>
317321
</dd>
318322
</dl>
319323
</section>
320324
<section id="format-menu-editor-window-only">
321325
<span id="format-menu"></span><h3>Format menu (Editor window only)<a class="headerlink" href="#format-menu-editor-window-only" title="Permalink to this heading"></a></h3>
322326
<dl class="simple">
327+
<dt>Format Paragraph</dt><dd><p>Reformat the current blank-line-delimited paragraph in comment block or
328+
multiline string or selected line in a string. All lines in the
329+
paragraph will be formatted to less than N columns, where N defaults to 72.</p>
330+
</dd>
323331
<dt>Indent Region</dt><dd><p>Shift selected lines right by the indent width (default 4 spaces).</p>
324332
</dd>
325333
<dt>Dedent Region</dt><dd><p>Shift selected lines left by the indent width (default 4 spaces).</p>
@@ -338,11 +346,7 @@ <h3>Edit menu (Shell and Editor)<a class="headerlink" href="#edit-menu-shell-and
338346
<dt>New Indent Width</dt><dd><p>Open a dialog to change indent width. The accepted default by the Python
339347
community is 4 spaces.</p>
340348
</dd>
341-
<dt>Format Paragraph</dt><dd><p>Reformat the current blank-line-delimited paragraph in comment block or
342-
multiline string or selected line in a string. All lines in the
343-
paragraph will be formatted to less than N columns, where N defaults to 72.</p>
344-
</dd>
345-
<dt>Strip trailing whitespace</dt><dd><p>Remove trailing space and other whitespace characters after the last
349+
<dt>Strip Trailing Chitespace</dt><dd><p>Remove trailing space and other whitespace characters after the last
346350
non-whitespace character of a line by applying str.rstrip to each line,
347351
including lines within multiline strings. Except for Shell windows,
348352
remove extra newlines at the end of the file.</p>
@@ -565,6 +569,13 @@ <h3>Automatic indentation<a class="headerlink" href="#automatic-indentation" tit
565569
<p>See also the indent/dedent region commands on the
566570
<a class="reference internal" href="#format-menu"><span class="std std-ref">Format menu</span></a>.</p>
567571
</section>
572+
<section id="search-and-replace">
573+
<h3>Search and Replace<a class="headerlink" href="#search-and-replace" title="Permalink to this heading"></a></h3>
574+
<p>Any selection becomes a search target. However, only selections within
575+
a line work because searches are only performed within lines with the
576+
terminal newline removed. If <code class="docutils literal notranslate"><span class="pre">[x]</span> <span class="pre">Regular</span> <span class="pre">expresion</span></code> is checked, the
577+
target is interpreted according to the Python re module.</p>
578+
</section>
568579
<section id="completions">
569580
<span id="id3"></span><h3>Completions<a class="headerlink" href="#completions" title="Permalink to this heading"></a></h3>
570581
<p>Completions are supplied, when requested and available, for module
@@ -1021,6 +1032,7 @@ <h3><a href="../contents.html">Table of Contents</a></h3>
10211032
<li><a class="reference internal" href="#editor-windows">Editor windows</a></li>
10221033
<li><a class="reference internal" href="#key-bindings">Key bindings</a></li>
10231034
<li><a class="reference internal" href="#automatic-indentation">Automatic indentation</a></li>
1035+
<li><a class="reference internal" href="#search-and-replace">Search and Replace</a></li>
10241036
<li><a class="reference internal" href="#completions">Completions</a></li>
10251037
<li><a class="reference internal" href="#calltips">Calltips</a></li>
10261038
<li><a class="reference internal" href="#code-context">Code Context</a></li>
@@ -1141,7 +1153,7 @@ <h3>Navigation</h3>
11411153
<br />
11421154
<br />
11431155

1144-
Last updated on Jul 03, 2022.
1156+
Last updated on Aug 05, 2022.
11451157
<a href="/bugs.html">Found a bug</a>?
11461158
<br />
11471159

Lib/test/test_grp.py

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -49,10 +49,12 @@ def test_values_extended(self):
4949

5050
def test_errors(self):
5151
self.assertRaises(TypeError, grp.getgrgid)
52+
self.assertRaises(TypeError, grp.getgrgid, 3.14)
5253
self.assertRaises(TypeError, grp.getgrnam)
54+
self.assertRaises(TypeError, grp.getgrnam, 42)
5355
self.assertRaises(TypeError, grp.getgrall, 42)
5456
# embedded null character
55-
self.assertRaises(ValueError, grp.getgrnam, 'a\x00b')
57+
self.assertRaisesRegex(ValueError, 'null', grp.getgrnam, 'a\x00b')
5658

5759
# try to get some errors
5860
bynames = {}

Lib/test/test_pwd.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,8 @@ def test_errors(self):
5959
self.assertRaises(TypeError, pwd.getpwnam)
6060
self.assertRaises(TypeError, pwd.getpwnam, 42)
6161
self.assertRaises(TypeError, pwd.getpwall, 42)
62+
# embedded null character
63+
self.assertRaisesRegex(ValueError, 'null', pwd.getpwnam, 'a\x00b')
6264

6365
# try to get some errors
6466
bynames = {}

0 commit comments

Comments
 (0)