Skip to content

Commit 4ae9d0e

Browse files
authored
Merge branch 'main' into array
2 parents 469a42a + 98fa4a4 commit 4ae9d0e

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

43 files changed

+2118
-1868
lines changed

Doc/library/functions.rst

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1405,10 +1405,10 @@ are always available. They are listed here in alphabetical order.
14051405
:func:`io.TextIOWrapper.reconfigure`. When no *buffering* argument is
14061406
given, the default buffering policy works as follows:
14071407

1408-
* Binary files are buffered in fixed-size chunks; the size of the buffer is
1409-
chosen using a heuristic trying to determine the underlying device's "block
1410-
size" and falling back on :const:`io.DEFAULT_BUFFER_SIZE`. On many systems,
1411-
the buffer will typically be 4096 or 8192 bytes long.
1408+
* Binary files are buffered in fixed-size chunks; the size of the buffer
1409+
is ``max(min(blocksize, 8 MiB), DEFAULT_BUFFER_SIZE)``
1410+
when the device block size is available.
1411+
On most systems, the buffer will typically be 128 kilobytes long.
14121412

14131413
* "Interactive" text files (files for which :meth:`~io.IOBase.isatty`
14141414
returns ``True``) use line buffering. Other text files use the policy

Doc/library/pdb.rst

Lines changed: 17 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -75,25 +75,34 @@ The debugger's prompt is ``(Pdb)``, which is the indicator that you are in debug
7575
arguments of the ``p`` command.
7676

7777

78+
.. program:: pdb
79+
7880
You can also invoke :mod:`pdb` from the command line to debug other scripts. For
7981
example::
8082

81-
python -m pdb myscript.py
83+
python -m pdb [-c command] (-m module | pyfile) [args ...]
8284

8385
When invoked as a module, pdb will automatically enter post-mortem debugging if
8486
the program being debugged exits abnormally. After post-mortem debugging (or
8587
after normal exit of the program), pdb will restart the program. Automatic
8688
restarting preserves pdb's state (such as breakpoints) and in most cases is more
8789
useful than quitting the debugger upon program's exit.
8890

89-
.. versionchanged:: 3.2
90-
Added the ``-c`` option to execute commands as if given
91-
in a :file:`.pdbrc` file; see :ref:`debugger-commands`.
91+
.. option:: -c, --command <command>
9292

93-
.. versionchanged:: 3.7
94-
Added the ``-m`` option to execute modules similar to the way
95-
``python -m`` does. As with a script, the debugger will pause execution just
96-
before the first line of the module.
93+
To execute commands as if given in a :file:`.pdbrc` file; see
94+
:ref:`debugger-commands`.
95+
96+
.. versionchanged:: 3.2
97+
Added the ``-c`` option.
98+
99+
.. option:: -m <module>
100+
101+
To execute modules similar to the way ``python -m`` does. As with a script,
102+
the debugger will pause execution just before the first line of the module.
103+
104+
.. versionchanged:: 3.7
105+
Added the ``-m`` option.
97106

98107
Typical usage to execute a statement under control of the debugger is::
99108

Doc/library/time.rst

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -52,9 +52,13 @@ An explanation of some terminology and conventions is in order.
5252
single: Coordinated Universal Time
5353
single: Greenwich Mean Time
5454

55-
* UTC is Coordinated Universal Time (formerly known as Greenwich Mean Time, or
56-
GMT). The acronym UTC is not a mistake but a compromise between English and
57-
French.
55+
* UTC is `Coordinated Universal Time`_ and superseded `Greenwich Mean Time`_ or
56+
GMT as the basis of international timekeeping. The acronym UTC is not a
57+
mistake but conforms to an earlier, language-agnostic naming scheme for time
58+
standards such as UT0, UT1, and UT2.
59+
60+
.. _Coordinated Universal Time: https://en.wikipedia.org/wiki/Coordinated_Universal_Time
61+
.. _Greenwich Mean Time: https://en.wikipedia.org/wiki/Greenwich_Mean_Time
5862

5963
.. index:: single: Daylight Saving Time
6064

Doc/library/webbrowser.rst

Lines changed: 12 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -40,14 +40,23 @@ a new tab, with the browser being brought to the foreground. The use of the
4040
:mod:`webbrowser` module on iOS requires the :mod:`ctypes` module. If
4141
:mod:`ctypes` isn't available, calls to :func:`.open` will fail.
4242

43+
.. program:: webbrowser
44+
4345
The script :program:`webbrowser` can be used as a command-line interface for the
4446
module. It accepts a URL as the argument. It accepts the following optional
4547
parameters:
4648

47-
* ``-n``/``--new-window`` opens the URL in a new browser window, if possible.
48-
* ``-t``/``--new-tab`` opens the URL in a new browser page ("tab").
49+
.. option:: -n, --new-window
50+
51+
Opens the URL in a new browser window, if possible.
52+
53+
.. option:: -t, --new-tab
54+
55+
Opens the URL in a new browser tab.
56+
57+
The options are, naturally, mutually exclusive. Usage example:
4958

50-
The options are, naturally, mutually exclusive. Usage example::
59+
.. code-block:: bash
5160
5261
python -m webbrowser -t "https://www.python.org"
5362

Doc/library/zipfile.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -554,6 +554,14 @@ Path Objects
554554
e.g. 'dir/file.txt', 'dir/', or ''. Defaults to the empty string,
555555
indicating the root.
556556

557+
.. note::
558+
The :class:`Path` class does not sanitize filenames within the ZIP archive. Unlike
559+
the :meth:`ZipFile.extract` and :meth:`ZipFile.extractall` methods, it is the
560+
caller's responsibility to validate or sanitize filenames to prevent path traversal
561+
vulnerabilities (e.g., filenames containing ".." or absolute paths). When handling
562+
untrusted archives, consider resolving filenames using :func:`os.path.abspath`
563+
and checking against the target directory with :func:`os.path.commonpath`.
564+
557565
Path objects expose the following features of :mod:`pathlib.Path`
558566
objects:
559567

Include/internal/pycore_magic_number.h

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -270,7 +270,8 @@ Known values:
270270
Python 3.14a5 3615 (CALL_FUNCTION_EX always take a kwargs argument)
271271
Python 3.14a5 3616 (Remove BINARY_SUBSCR and family. Make them BINARY_OPs)
272272
Python 3.14a6 3617 (Branch monitoring for async for loops)
273-
Python 3.14a6 3618 (Renumber RESUME opcode from 149 to 128)
273+
Python 3.14a6 3618 (Add oparg to END_ASYNC_FOR)
274+
Python 3.14a6 3619 (Renumber RESUME opcode from 149 to 128)
274275
275276
Python 3.15 will start with 3650
276277
@@ -283,7 +284,7 @@ PC/launcher.c must also be updated.
283284
284285
*/
285286

286-
#define PYC_MAGIC_NUMBER 3618
287+
#define PYC_MAGIC_NUMBER 3619
287288
/* This is equivalent to converting PYC_MAGIC_NUMBER to 2 bytes
288289
(little-endian) and then appending b'\r\n'. */
289290
#define PYC_MAGIC_NUMBER_TOKEN \

Include/internal/pycore_opcode_metadata.h

Lines changed: 2 additions & 2 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Include/opcode_ids.h

Lines changed: 59 additions & 59 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

0 commit comments

Comments
 (0)