Skip to content

Commit 0e2484a

Browse files
Merge branch 'main' into realpath-all-but-last
2 parents b76a1c5 + e29171b commit 0e2484a

File tree

71 files changed

+1916
-681
lines changed

Some content is hidden

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

71 files changed

+1916
-681
lines changed

Doc/howto/free-threading-extensions.rst

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -23,6 +23,14 @@ You can use it to enable code that only runs under the free-threaded build::
2323
/* code that only runs in the free-threaded build */
2424
#endif
2525

26+
.. note::
27+
28+
On Windows, this macro is not defined automatically, but must be specified
29+
to the compiler when building. The :func:`sysconfig.get_config_var` function
30+
can be used to determine whether the current running interpreter had the
31+
macro defined.
32+
33+
2634
Module Initialization
2735
=====================
2836

Doc/library/base64.rst

Lines changed: 37 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -15,22 +15,17 @@
1515

1616
This module provides functions for encoding binary data to printable
1717
ASCII characters and decoding such encodings back to binary data.
18-
It provides encoding and decoding functions for the encodings specified in
19-
:rfc:`4648`, which defines the Base16, Base32, and Base64 algorithms,
20-
and for the de-facto standard Ascii85 and Base85 encodings.
21-
22-
The :rfc:`4648` encodings are suitable for encoding binary data so that it can be
23-
safely sent by email, used as parts of URLs, or included as part of an HTTP
24-
POST request. The encoding algorithm is not the same as the
25-
:program:`uuencode` program.
18+
This includes the :ref:`encodings specified in <base64-rfc-4648>`
19+
:rfc:`4648` (Base64, Base32 and Base16)
20+
and the non-standard :ref:`Base85 encodings <base64-base-85>`.
2621

2722
There are two interfaces provided by this module. The modern interface
2823
supports encoding :term:`bytes-like objects <bytes-like object>` to ASCII
2924
:class:`bytes`, and decoding :term:`bytes-like objects <bytes-like object>` or
3025
strings containing ASCII to :class:`bytes`. Both base-64 alphabets
3126
defined in :rfc:`4648` (normal, and URL- and filesystem-safe) are supported.
3227

33-
The legacy interface does not support decoding from strings, but it does
28+
The :ref:`legacy interface <base64-legacy>` does not support decoding from strings, but it does
3429
provide functions for encoding and decoding to and from :term:`file objects
3530
<file object>`. It only supports the Base64 standard alphabet, and it adds
3631
newlines every 76 characters as per :rfc:`2045`. Note that if you are looking
@@ -46,7 +41,15 @@ package instead.
4641
Any :term:`bytes-like objects <bytes-like object>` are now accepted by all
4742
encoding and decoding functions in this module. Ascii85/Base85 support added.
4843

49-
The modern interface provides:
44+
45+
.. _base64-rfc-4648:
46+
47+
RFC 4648 Encodings
48+
------------------
49+
50+
The :rfc:`4648` encodings are suitable for encoding binary data so that it can be
51+
safely sent by email, used as parts of URLs, or included as part of an HTTP
52+
POST request.
5053

5154
.. function:: b64encode(s, altchars=None)
5255

@@ -181,6 +184,26 @@ The modern interface provides:
181184
incorrectly padded or if there are non-alphabet characters present in the
182185
input.
183186

187+
.. _base64-base-85:
188+
189+
Base85 Encodings
190+
-----------------
191+
192+
Base85 encoding is not formally specified but rather a de facto standard,
193+
thus different systems perform the encoding differently.
194+
195+
The :func:`a85encode` and :func:`b85encode` functions in this module are two implementations of
196+
the de facto standard. You should call the function with the Base85
197+
implementation used by the software you intend to work with.
198+
199+
The two functions present in this module differ in how they handle the following:
200+
201+
* Whether to include enclosing ``<~`` and ``~>`` markers
202+
* Whether to include newline characters
203+
* The set of ASCII characters used for encoding
204+
* Handling of null bytes
205+
206+
Refer to the documentation of the individual functions for more information.
184207

185208
.. function:: a85encode(b, *, foldspaces=False, wrapcol=0, pad=False, adobe=False)
186209

@@ -262,7 +285,10 @@ The modern interface provides:
262285
.. versionadded:: 3.13
263286

264287

265-
The legacy interface:
288+
.. _base64-legacy:
289+
290+
Legacy Interface
291+
----------------
266292

267293
.. function:: decode(input, output)
268294

Doc/library/multiprocessing.rst

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1369,6 +1369,12 @@ object -- see :ref:`multiprocessing-managers`.
13691369
A solitary difference from its close analog exists: its ``acquire`` method's
13701370
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
13711371

1372+
.. method:: locked()
1373+
1374+
Return a boolean indicating whether this object is locked right now.
1375+
1376+
.. versionadded:: 3.14
1377+
13721378
.. note::
13731379
On macOS, this is indistinguishable from :class:`Semaphore` because
13741380
``sem_getvalue()`` is not implemented on that platform.
@@ -1521,6 +1527,12 @@ object -- see :ref:`multiprocessing-managers`.
15211527
A solitary difference from its close analog exists: its ``acquire`` method's
15221528
first argument is named *block*, as is consistent with :meth:`Lock.acquire`.
15231529

1530+
.. method:: locked()
1531+
1532+
Return a boolean indicating whether this object is locked right now.
1533+
1534+
.. versionadded:: 3.14
1535+
15241536
.. note::
15251537

15261538
On macOS, ``sem_timedwait`` is unsupported, so calling ``acquire()`` with

Doc/library/re.rst

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -991,8 +991,8 @@ Functions
991991
That way, separator components are always found at the same relative
992992
indices within the result list.
993993

994-
Empty matches for the pattern split the string only when not adjacent
995-
to a previous empty match.
994+
Adjacent empty matches are not possible, but an empty match can occur
995+
immediately after a non-empty match.
996996

997997
.. code:: pycon
998998
@@ -1095,9 +1095,12 @@ Functions
10951095

10961096
The optional argument *count* is the maximum number of pattern occurrences to be
10971097
replaced; *count* must be a non-negative integer. If omitted or zero, all
1098-
occurrences will be replaced. Empty matches for the pattern are replaced only
1099-
when not adjacent to a previous empty match, so ``sub('x*', '-', 'abxd')`` returns
1100-
``'-a-b--d-'``.
1098+
occurrences will be replaced.
1099+
1100+
Adjacent empty matches are not possible, but an empty match can occur
1101+
immediately after a non-empty match.
1102+
As a result, ``sub('x*', '-', 'abxd')`` returns ``'-a-b--d-'``
1103+
instead of ``'-a-b-d-'``.
11011104

11021105
.. index:: single: \g; in regular expressions
11031106

@@ -1128,8 +1131,7 @@ Functions
11281131
.. versionchanged:: 3.7
11291132
Unknown escapes in *repl* consisting of ``'\'`` and an ASCII letter
11301133
now are errors.
1131-
Empty matches for the pattern are replaced when adjacent to a previous
1132-
non-empty match.
1134+
An empty match can occur immediately after a non-empty match.
11331135

11341136
.. versionchanged:: 3.12
11351137
Group *id* can only contain ASCII digits.

Doc/library/socketserver.rst

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ There are four basic concrete server classes:
2424
:meth:`~BaseServer.server_activate`. The other parameters are passed to
2525
the :class:`BaseServer` base class.
2626

27+
.. versionchanged:: next
28+
The default queue size is now ``socket.SOMAXCONN`` for :class:`socketserver.TCPServer`.
2729

2830
.. class:: UDPServer(server_address, RequestHandlerClass, bind_and_activate=True)
2931

Doc/whatsnew/3.14.rst

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -829,6 +829,12 @@ Kumar Aditya, Edgar Margffoy, and many others.
829829
Some of these contributors are employed by Meta, which has continued to provide
830830
significant engineering resources to support this project.
831831

832+
From 3.14, when compiling extension modules for the free-threaded build of
833+
CPython on Windows, the preprocessor variable ``Py_GIL_DISABLED`` now needs to
834+
be specified by the build backend, as it will no longer be determined
835+
automatically by the C compiler. For a running interpreter, the setting that
836+
was used at compile time can be found using :func:`sysconfig.get_config_var`.
837+
832838

833839
.. _whatsnew314-pyrepl-highlighting:
834840

Doc/whatsnew/3.15.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,15 @@ sysconfig
145145
(Contributed by Filipe Laíns in :gh:`92897`.)
146146

147147

148+
threading
149+
---------
150+
151+
* Remove support for arbitrary positional or keyword arguments in the C
152+
implementation of :class:`~threading.RLock` objects. This was deprecated
153+
in Python 3.14.
154+
(Contributed by Bénédikt Tran in :gh:`134087`.)
155+
156+
148157
typing
149158
------
150159

Include/Python.h

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -59,6 +59,14 @@
5959
# include <intrin.h> // __readgsqword()
6060
#endif
6161

62+
// Suppress known warnings in Python header files.
63+
#if defined(_MSC_VER)
64+
// Warning that alignas behaviour has changed. Doesn't affect us, because we
65+
// never relied on the old behaviour.
66+
#pragma warning(push)
67+
#pragma warning(disable: 5274)
68+
#endif
69+
6270
// Include Python header files
6371
#include "pyport.h"
6472
#include "pymacro.h"
@@ -138,4 +146,9 @@
138146
#include "cpython/pyfpe.h"
139147
#include "cpython/tracemalloc.h"
140148

149+
// Restore warning filter
150+
#ifdef _MSC_VER
151+
#pragma warning(pop)
152+
#endif
153+
141154
#endif /* !Py_PYTHON_H */

Include/internal/pycore_opcode_metadata.h

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

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy