]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 months ago[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)
Rafael Fontenelle [Mon, 25 Nov 2024 19:48:00 +0000 (16:48 -0300)] 
[3.12] Fix a few typos found in the docs (GH-127126) (GH-127185)

(cherry picked from commit 39e60aeb3837f1f23d8b7f30d3b8d9faf805ef88)

11 months ago[3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value...
Miss Islington (bot) [Mon, 25 Nov 2024 17:51:21 +0000 (18:51 +0100)] 
[3.12] gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219) (#127263)

gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219)
(cherry picked from commit a2ee89968299fc4f0da4b5a4165025b941213ba5)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
11 months ago[3.12] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610...
Miss Islington (bot) [Mon, 25 Nov 2024 12:18:35 +0000 (13:18 +0100)] 
[3.12] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610) (GH-127160)

(cherry picked from commit 7725c0371a93be3ccfaff4871014a80bdf0ea274)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
11 months ago[3.12] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127240)
Yuki Kobayashi [Mon, 25 Nov 2024 08:51:48 +0000 (17:51 +0900)] 
[3.12] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127240)

11 months ago[3.12] gh-127217: Fix pathname2url() for paths starting with multiple slashes on...
Miss Islington (bot) [Sun, 24 Nov 2024 18:13:23 +0000 (19:13 +0100)] 
[3.12] gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) (GH-127231)

(cherry picked from commit 97b2ceaaaf88a73a45254912a0e972412879ccbf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)
Miss Islington (bot) [Sun, 24 Nov 2024 17:48:12 +0000 (18:48 +0100)] 
[3.12] Improve `pathname2url()` and `url2pathname()` docs (GH-127125) (#127233)

Improve `pathname2url()` and `url2pathname()` docs (GH-127125)

These functions have long sown confusion among Python developers. The
existing documentation says they deal with URL path components, but that
doesn't fit the evidence on Windows:

    >>> pathname2url(r'C:\foo')
    '///C:/foo'
    >>> pathname2url(r'\\server\share')
    '////server/share'  # or '//server/share' as of quite recently

If these were URL path components, they would imply complete URLs like
`file://///C:/foo` and `file://////server/share`. Clearly this isn't right.
Yet the implementation in `nturl2path` is deliberate, and the
`url2pathname()` function correctly inverts it.

On non-Windows platforms, the behaviour until quite recently is to simply
quote/unquote the path without adding or removing any leading slashes. This
behaviour is compatible with *both* interpretations -- 1) the value is a
URL path component (existing docs), and 2) the value is everything
following `file:` (this commit)

The conclusion I draw is that these functions operate on everything after
the `file:` prefix, which may include an authority section. This is the
only explanation that fits both the  Windows and non-Windows behaviour.
It's also a better match for the function names.
(cherry picked from commit 307c63358681d669ae39e5ecd814bded4a93443a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] Fix "useable" typo in docs (GH-127200) (#127206)
Miss Islington (bot) [Sat, 23 Nov 2024 21:45:47 +0000 (22:45 +0100)] 
[3.12] Fix "useable" typo in docs (GH-127200) (#127206)

Fix "useable" typo in docs (GH-127200)

Fix typo in docs
(cherry picked from commit dbd23790dbd662169905be6300259992639d4e69)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
11 months ago[3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127202)
Miss Islington (bot) [Sat, 23 Nov 2024 19:55:55 +0000 (20:55 +0100)] 
[3.12] Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667) (#127202)

Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b25a58f512d8c7083a752c89436eb0d)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
11 months ago[3.12] gh-109746: Make _thread.start_new_thread delete state of new thread on its...
Serhiy Storchaka [Fri, 22 Nov 2024 19:56:39 +0000 (21:56 +0200)] 
[3.12] gh-109746: Make _thread.start_new_thread delete state of new thread on its startup failure (GH-109761) (GH-127173)

If Python fails to start newly created thread
due to failure of underlying PyThread_start_new_thread() call,
its state should be removed from interpreter' thread states list
to avoid its double cleanup.

(cherry picked from commit ca3ea9ad05c3d876a58463595e5b4228fda06936)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
11 months ago[3.12] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH...
Serhiy Storchaka [Fri, 22 Nov 2024 16:33:50 +0000 (18:33 +0200)] 
[3.12] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127158)

* Name without a PATHEXT extension is only searched if the mode does not
  include X_OK.
* Support multi-component PATHEXT extensions (e.g. ".foo.bar").
* Support files without extensions in PATHEXT contains dot-only extension
  (".", "..", etc).
* Support PATHEXT extensions that end with a dot (e.g. ".foo.").
(cherry picked from commit 8899e85de100557899da05f0b37867a371a73800)

11 months ago[3.12] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127148)
Miss Islington (bot) [Fri, 22 Nov 2024 14:13:43 +0000 (15:13 +0100)] 
[3.12] GH-122679: Add `register()` to argparse docs (GH-126939) (GH-127148)

(cherry picked from commit fcfdb55465636afc256bc29781b283404d88e6ca)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
11 months ago[3.12] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes...
Jun Komoda [Fri, 22 Nov 2024 13:08:37 +0000 (22:08 +0900)] 
[3.12] gh-127082: Replace "Windows only" with the `availability: Windows` in `ctypes` doc (GH-127099) (#127145)

(cherry picked from commit 3c770e3f0978d825c5ebea98fcd654660e7e135f)

11 months ago[3.12] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path...
Miss Islington (bot) [Fri, 22 Nov 2024 04:37:51 +0000 (05:37 +0100)] 
[3.12] GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132) (#127136)

GH-127078: `url2pathname()`: handle extra slash before UNC drive in URL path (GH-127132)

Decode a file URI like `file://///server/share` as a UNC path like
`\\server\share`. This form of file URI is created by software the simply
prepends `file:///` to any absolute Windows path.
(cherry picked from commit 8c98ed846a7d7e50c4cf06f823d94737144dcf6a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127131)
Miss Islington (bot) [Fri, 22 Nov 2024 03:42:46 +0000 (04:42 +0100)] 
[3.12] GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129) (#127131)

GH-126766: `url2pathname()`: handle 'localhost' authority (GH-127129)

Discard any 'localhost' authority from the beginning of a `file:` URI. As a
result, file URIs like `//localhost/etc/hosts` are correctly decoded as
`/etc/hosts`.
(cherry picked from commit ebf564a1d3e2e81b9846535114e481d6096443d2)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098)
Serhiy Storchaka [Thu, 21 Nov 2024 11:44:37 +0000 (13:44 +0200)] 
[3.12] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127098)

It now returns multiple era description segments separated by semicolons.
Previously it only returned the first segment on platforms with Glibc.
(cherry picked from commit 4803cd0244847f286641c85591fda08b513cea52)

11 months ago[3.12] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH...
Miss Islington (bot) [Thu, 21 Nov 2024 11:32:16 +0000 (12:32 +0100)] 
[3.12] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH-127095)

* Fix support of STRING and GLOBAL opcodes with non-ASCII arguments.
* dis() now outputs non-ASCII bytes in STRING, BINSTRING and
  SHORT_BINSTRING arguments as escaped (\xXX).
(cherry picked from commit eaf217108226633c03cc5c4c90f0b6e4587c8803)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] Run `apt update` before `apt install git` in autoconf CI job (GH-127071)
Miss Islington (bot) [Wed, 20 Nov 2024 19:37:24 +0000 (20:37 +0100)] 
[3.12] Run `apt update` before `apt install git` in autoconf CI job (GH-127071)

(cherry picked from commit 0af4ec30bd2e3a52350344d1011c0c125d6dcd71)

Co-authored-by: Zachary Ware <zach@python.org>
11 months ago[3.12] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127064)
Miss Islington (bot) [Wed, 20 Nov 2024 15:49:58 +0000 (16:49 +0100)] 
[3.12] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127064)

This catches a memory leak in loading the BUILD opcode.
(cherry picked from commit addb225f3823b03774cddacce35214dd471bec46)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH...
Miss Islington (bot) [Tue, 19 Nov 2024 21:55:10 +0000 (22:55 +0100)] 
[3.12] GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852) (#127040)

GH-85168: Use filesystem encoding when converting to/from `file` URIs (GH-126852)

Adjust `urllib.request.url2pathname()` and `pathname2url()` to use the
filesystem encoding when quoting and unquoting file URIs, rather than
forcing use of UTF-8.

No changes are needed in the `nturl2path` module because Windows always
uses UTF-8, per PEP 529.
(cherry picked from commit c9b399fbdb01584dcfff0d7f6ad484644ff269c3)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990...
Miss Islington (bot) [Tue, 19 Nov 2024 18:19:18 +0000 (19:19 +0100)] 
[3.12] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990) (GH-127019)

If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable.
(cherry picked from commit 29cbcbd73bbfd8c953c0b213fb33682c289934ff)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
11 months ago[3.12] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127016)
Miss Islington (bot) [Tue, 19 Nov 2024 15:41:41 +0000 (16:41 +0100)] 
[3.12] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127016)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.12] gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941...
Russell Keith-Magee [Tue, 19 Nov 2024 10:01:54 +0000 (18:01 +0800)] 
[3.12] gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941) (GH-126959)

(cherry picked from commit 3938fd60c0c88891b213097380aeea91a45bcd77)

11 months ago[3.12] gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754) (#127005)
Miss Islington (bot) [Tue, 19 Nov 2024 08:33:18 +0000 (09:33 +0100)] 
[3.12] gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754) (#127005)

gh-126594: Fix typeobject.c wrap_buffer() cast (GH-126754)

Reject flags smaller than INT_MIN.

(cherry picked from commit 84f07c3a4cbcfe488ccfb4030571be0bc4de7e45)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11 months ago[3.12] gh-126911: Update credits output (GH-126913) (#126974)
Miss Islington (bot) [Mon, 18 Nov 2024 15:58:22 +0000 (16:58 +0100)] 
[3.12] gh-126911: Update credits output (GH-126913) (#126974)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.12] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930...
Miss Islington (bot) [Mon, 18 Nov 2024 13:22:58 +0000 (14:22 +0100)] 
[3.12] gh-126909: Fix running xattr tests on systems with lower limits (GH-126930) (#126964)

gh-126909: Fix running xattr tests on systems with lower limits (GH-126930)

Modify the extended attribute tests to write fewer and smaller extended
attributes, in order to fit within filesystems with total xattr limit
of 1 KiB (e.g. ext4 with 1 KiB blocks).  Previously, the test would
write over 2 KiB, making it fail with ENOSPC on such systems.
(cherry picked from commit 2c0a21c1aad65ab8362491acf856eb574b1257ad)

Co-authored-by: Michał Górny <mgorny@gentoo.org>
11 months ago[3.12] gh-101955: Fix SystemError in possesive quantifier with alternative and group...
Miss Islington (bot) [Mon, 18 Nov 2024 12:03:19 +0000 (13:03 +0100)] 
[3.12] gh-101955: Fix SystemError in possesive quantifier with alternative and group (GH-111362) (GH-126963)

(cherry picked from commit f9c5573dedcb2f2e9ae152672ce157987cdea612)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126961)
Serhiy Storchaka [Mon, 18 Nov 2024 11:24:13 +0000 (13:24 +0200)] 
[3.12] gh-67877: Fix memory leaks in terminated RE matching (GH-126840) (GH-126961)

If SRE(match) function terminates abruptly, either because of a signal
or because memory allocation fails, allocated SRE_REPEAT blocks might
be never released.

(cherry picked from commit 7538e7f5696408fa0aa02fce8a413a7dfac76a04)

11 months ago[3.12] gh-124452: Fix header mismatches when folding/unfolding with email message...
Miss Islington (bot) [Sun, 17 Nov 2024 20:12:29 +0000 (21:12 +0100)] 
[3.12] gh-124452: Fix header mismatches when folding/unfolding with email message (GH-125919) (#126916)

gh-124452: Fix header mismatches when folding/unfolding with email message (GH-125919)

The header-folder of the new email API has a long standing known buglet where
if the first token is longer than max_line_length, it puts that token on the next
line.  It turns out there is also a *parsing* bug when parsing such a header:
the space prefixing that first, non-empty line gets preserved and tacked on to
the start of the header value, which is not the expected behavior per the RFCs.
The bug arises from the fact that the parser assumed that there would be at
least one token on the line with the header, which is going to be true for
probably every email producer other than the python email library with its
folding buglet.  Clearly, though, this is a case that needs to be handled
correctly.  The fix is simple: strip the blanks off the start of the whole
value, not just the first physical line of the value.

(cherry picked from commit ed81971e6b26c34445f06850192b34458b029337)

Co-authored-by: RanKKI <hliu86.me@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] GH-126789: fix some sysconfig data on late site initializations
Miss Islington (bot) [Sun, 17 Nov 2024 00:26:59 +0000 (01:26 +0100)] 
[3.12] GH-126789: fix some sysconfig data on late site initializations

Co-authored-by: Filipe Laíns 🇵🇸 <lains@riseup.net>
11 months ago[3.12] gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input...
Miss Islington (bot) [Fri, 15 Nov 2024 23:20:10 +0000 (00:20 +0100)] 
[3.12] gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484) (GH-126878)

gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484)
(cherry picked from commit 3be7498d2450519d5d8f63a35ef298db3b3d935b)

Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
11 months ago[3.12] Added a warning to the urljoin docs, indicating that it is not safe to use...
Miss Islington (bot) [Fri, 15 Nov 2024 23:17:37 +0000 (00:17 +0100)] 
[3.12] Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659) (#126889)

Added a warning to the urljoin docs, indicating that it is not safe to use with attacker controlled URLs (GH-126659)

This was flagged to me at a party today by someone who works in red-teaming as a frequently encountered footgun. Documenting the potentially unexpected behavior seemed like a good place to start.
(cherry picked from commit d6bcc154e93a0a20ab97187d3e8b726fffb14f8f)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
11 months ago[3.12] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126870)
Miss Islington (bot) [Fri, 15 Nov 2024 14:04:35 +0000 (15:04 +0100)] 
[3.12] gh-71936: Fix race condition in multiprocessing.Pool (GH-124973) (GH-126870)

Proxes of shared objects register a Finalizer in BaseProxy._incref(), and it
will call BaseProxy._decref() when it is GCed. This may cause a race condition
with Pool(maxtasksperchild=None) on Windows.

A connection would be closed and raised TypeError when a GC occurs between
_ConnectionBase._check_writable() and _ConnectionBase._send_bytes() in
_ConnectionBase.send() in the second or later task, and a new object
is allocated that shares the id() of a previously deleted one.

Instead of using the id() of the token (or the proxy), use a unique,
non-reusable number.

(cherry picked from commit ba088c8f9cf7163b0f28c507cb1343befe21997e)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Akinori Hattori <hattya@gmail.com>
11 months ago[3.12] gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH...
Miss Islington (bot) [Fri, 15 Nov 2024 13:07:04 +0000 (14:07 +0100)] 
[3.12] gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182) (GH-126824)

gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182)

* gh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance

This changes nothing changes for CPython supported platforms,
but hints how to deal with platforms that stick to the letter of
the spec.
It also marks `socket.getaddrinfo` as a wrapper around `getaddrinfo(3)`;
specifically, workarounds to make the function work consistently across
platforms are out of scope in its code.

Include wording similar to the POSIX's “by providing options and by
limiting the returned information”, which IMO suggests that the
hints limit the resulting list compared to the defaults, *but* can
be interpreted differently. Details are added in a note.

Specifically say that this wraps the underlying C function. So, the
details are in OS docs. The “full range of results” bit goes away.

Use `AF_UNSPEC` rather than zero for the *family* default, although
I don't think a system where it's nonzero would be very usable.

Suggest setting proto and/or type (with examples, as the appropriate
values aren't obvious). Say why you probably want to do that that
on all systems; mention the behavior on the “letter of the spec”
systems.

Suggest that the results should be tried in order, which is,
AFAIK best practice -- see RFC 6724 section 2, and its predecessor
from 2003 (which are specific to IP, but indicate how people use this):

> Well-behaved applications SHOULD iterate through the list of
> addresses returned from `getaddrinfo()` until they find a working address.

(cherry picked from commit ff0ef0a54bef26fc507fbf9b7a6009eb7d3f17f5)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months ago[3.12] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126756)
Tomas R. [Fri, 15 Nov 2024 11:07:16 +0000 (12:07 +0100)] 
[3.12] gh-126413: Add translation tests for getopt and optparse (GH-126698) (GH-126756)

(cherry picked from commit dff074d1446bab23578a6b228b0c59a17006299c)

11 months ago[3.12] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) ...
Miss Islington (bot) [Thu, 14 Nov 2024 23:52:46 +0000 (00:52 +0100)] 
[3.12] GH-126766: `url2pathname()`: handle empty authority section. (GH-126767) (#126837)

GH-126766: `url2pathname()`: handle empty authority section. (GH-126767)

Discard two leading slashes from the beginning of a `file:` URI if they
introduce an empty authority section. As a result, file URIs like
`///etc/hosts` are correctly parsed as `/etc/hosts`.
(cherry picked from commit cae9d9d20f61cdbde0765efa340b6b596c31b67f)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126807: pygettext: Do not attempt to extract messages from function definit...
Miss Islington (bot) [Thu, 14 Nov 2024 22:35:35 +0000 (23:35 +0100)] 
[3.12] gh-126807: pygettext: Do not attempt to extract messages from function definitions. (GH-126808) (GH-126847)

Fixes a bug where pygettext would attempt
to extract a message from a code like this:

def _(x): pass

This is because pygettext only looks at one
token at a time and '_(x)' looks like a
function call.

However, since 'x' is not a string literal,
it would erroneously issue a warning.
(cherry picked from commit 9a456383bed52010b90bd491277ea855626a7bba)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
11 months ago[3.12] Document that return-less user-defined functions return None (GH-126769) ...
Miss Islington (bot) [Thu, 14 Nov 2024 09:46:26 +0000 (10:46 +0100)] 
[3.12] Document that return-less user-defined functions return None (GH-126769) (#126823)

Document that return-less user-defined functions return None (GH-126769)
(cherry picked from commit e0692f11650acb6c2eed940eb94650b4703c072e)

Co-authored-by: John Marshall <jmarshall@hey.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months ago[3.12] gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732...
Miss Islington (bot) [Thu, 14 Nov 2024 05:08:18 +0000 (06:08 +0100)] 
[3.12] gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732) (#126819)

gh-126731: Update outdated project information in `pprint.pp` doc (GH-126732)
(cherry picked from commit 6a93a1adbb56a64ec6d20e8aab911439998502c9)

Co-authored-by: Wulian <xiguawulian@gmail.com>
11 months ago[3.12] gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (GH-125800)
Miss Islington (bot) [Thu, 14 Nov 2024 05:06:14 +0000 (06:06 +0100)] 
[3.12] gh-124448: Update bundled Tcl/Tk in macOS installer to 8.6.15. (GH-125800)

(cherry picked from commit fc9e6bf53d1c9ce2b5f802864e0da265a77c111f)

Co-authored-by: Ned Deily <nad@python.org>
11 months ago[3.12] Docs: re-create pages for removed modules to document their removal, based...
Ned Batchelder [Thu, 14 Nov 2024 00:02:09 +0000 (19:02 -0500)] 
[3.12] Docs: re-create pages for removed modules to document their removal, based on GH-126622 (#126781)

[3.12] Docs: re-create pages for removed modules to document their removal, based on #126622

11 months ago[3.12] gh-126188: Update bundled pip to 24.3.1 (gh-126805) (gh-126813)
Stéphane Bidoul [Wed, 13 Nov 2024 23:42:54 +0000 (00:42 +0100)] 
[3.12] gh-126188: Update bundled pip to 24.3.1 (gh-126805) (gh-126813)

Update bundled pip to 24.3.1
(cherry picked from commit f6b0361c17552197f44be16435e4a5cb4b1d60ca)

11 months ago[3.12] GH-126606: don't write incomplete pyc files (GH-126627) (GH-126810)
Miss Islington (bot) [Wed, 13 Nov 2024 22:49:47 +0000 (23:49 +0100)] 
[3.12] GH-126606: don't write incomplete pyc files (GH-126627) (GH-126810)

GH-126606: don't write incomplete pyc files (GH-126627)
(cherry picked from commit c695e37a3f95c225ee08d1e882d23fa200b5ec34)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Brett Cannon <brett@python.org>
11 months ago[3.12] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792...
Miss Islington (bot) [Wed, 13 Nov 2024 18:50:29 +0000 (19:50 +0100)] 
[3.12] gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792) (GH-126797)

gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792)

Update libexpat to 2.6.4, make future updates easier.
(cherry picked from commit 3c9996909402fadc98e6ca2a64e75a71a7427352)

Co-authored-by: Seth Michael Larson <seth@python.org>
11 months ago[3.12] gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759...
Miss Islington (bot) [Wed, 13 Nov 2024 18:44:01 +0000 (19:44 +0100)] 
[3.12] gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759) (#126779)

gh-126341: add release check to `__iter__` method of `memoryview` (GH-126759)
(cherry picked from commit a12690ef49e8fc8a3af4c5f1757eb3caffb35e03)

Co-authored-by: Ritvik Pasham <ritvikpasham@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.12] bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces...
Miss Islington (bot) [Wed, 13 Nov 2024 09:20:47 +0000 (10:20 +0100)] 
[3.12] bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (GH-30196) (#126771)

bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (GH-30196)

---------

(cherry picked from commit 2e39d77ddeb51505d65fd54ccfcd72615c6b1927)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
11 months ago[3.12] gh-104745: Limit starting a patcher more than once without stopping it (GH...
Miss Islington (bot) [Wed, 13 Nov 2024 08:37:34 +0000 (09:37 +0100)] 
[3.12] gh-104745: Limit starting a patcher more than once without stopping it (GH-126649) (#126773)

gh-104745: Limit starting a patcher more than once without stopping it (GH-126649)

Previously, this would cause an `AttributeError` if the patch stopped more than once after this, and would also disrupt the original patched object.

---------

(cherry picked from commit 1e40c5ba47780ddd91868abb3aa064f5ba3015e4)

Co-authored-by: Red4Ru <39802734+Red4Ru@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months ago[3.12] GH-120423: `pathname2url()`: handle forward slashes in Windows paths (GH-12659...
Miss Islington (bot) [Tue, 12 Nov 2024 21:53:58 +0000 (22:53 +0100)] 
[3.12] GH-120423: `pathname2url()`: handle forward slashes in Windows paths (GH-126593) (#126763)

GH-120423: `pathname2url()`: handle forward slashes in Windows paths (GH-126593)

Adjust `urllib.request.pathname2url()` so that forward slashes in Windows
paths are handled identically to backward slashes.
(cherry picked from commit bf224bd7cef5d24eaff35945ebe7ffe14df7710f)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
11 months ago[3.12] gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (GH-126617...
Bénédikt Tran [Tue, 12 Nov 2024 14:05:23 +0000 (15:05 +0100)] 
[3.12] gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (GH-126617) (#126740)

gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (#126617)

11 months ago[3.12] gh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` (GH...
Miss Islington (bot) [Tue, 12 Nov 2024 13:04:25 +0000 (14:04 +0100)] 
[3.12] gh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` (GH-126733) (#126737)

gh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` (GH-126733)
(cherry picked from commit 37c57dfad12744608091653fd753a1f770e2479b)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
11 months ago[3.12] gh-126451: Revert backports of ABC registrations for contextvars.Context and...
Alex Waygood [Tue, 12 Nov 2024 12:26:23 +0000 (12:26 +0000)] 
[3.12] gh-126451: Revert backports of ABC registrations for contextvars.Context and multiprocessing proxies (#126735)

11 months ago[3.12] gh-126525: Fix `makeunicodedata.py` output on macOS and Windows (GH-126526...
Miss Islington (bot) [Tue, 12 Nov 2024 10:41:28 +0000 (11:41 +0100)] 
[3.12] gh-126525: Fix `makeunicodedata.py` output on macOS and Windows (GH-126526) (#126726)

gh-126525: Fix `makeunicodedata.py` output on macOS and Windows (GH-126526)
(cherry picked from commit f223efb2a2d6a3e86556be7295cbbd3ef839f489)

Co-authored-by: sobolevn <mail@sobolevn.me>
11 months ago[3.12] Fix error message of "Check if Autoconf files are up to date" job (GH-126683...
Miss Islington (bot) [Tue, 12 Nov 2024 08:10:55 +0000 (09:10 +0100)] 
[3.12] Fix error message of "Check if Autoconf files are up to date" job (GH-126683) (#126718)

Fix error message of "Check if Autoconf files are up to date" job (GH-126683)
(cherry picked from commit 0052a8c638518447baf39ae02b6ff6a309efd4ce)

Co-authored-by: sobolevn <mail@sobolevn.me>
11 months agoUpdate documentation links to Microsoft's documentation pages (GH-126379)
Miss Islington (bot) [Mon, 11 Nov 2024 17:20:33 +0000 (18:20 +0100)] 
Update documentation links to Microsoft's documentation pages (GH-126379)

(cherry picked from commit 6e25eb15410f781f632d536d555f38879432522c)

Co-authored-by: 谭九鼎 <109224573@qq.com>
11 months ago[3.12] gh-126505: Fix bugs in compiling case-insensitive character classes (GH-126557...
Miss Islington (bot) [Mon, 11 Nov 2024 16:47:37 +0000 (17:47 +0100)] 
[3.12] gh-126505: Fix bugs in compiling case-insensitive character classes (GH-126557) (GH-126690)

* upper-case non-BMP character was ignored
* the ASCII flag was ignored when matching a character range whose
  upper bound is beyond the BMP region
(cherry picked from commit 819830f34a11ecaa3aada174ca8eedeb3f260630)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
11 months ago[3.12] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHan...
Miss Islington (bot) [Mon, 11 Nov 2024 14:26:10 +0000 (15:26 +0100)] 
[3.12] gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503) (GH-126572)

gh-126500: test_ssl: Don't stop ThreadedEchoServer on OSError in ConnectionHandler; rely on __exit__ (GH-126503)

If `read()` in the ConnectionHandler thread raises `OSError` (except `ConnectionError`),
the ConnectionHandler shuts down the entire ThreadedEchoServer,
preventing further connections.
It also does that for `EPROTOTYPE` in `wrap_conn`.

As far as I can see, this is done to avoid the server thread getting stuck,
forgotten, in its accept loop. However, since 2011 (5b95eb90a7167285b6544b50865227c584943c9a)
the server is used as a context manager, and its `__exit__` does `stop()` and `join()`.
(I'm not sure if we *always* used `with` since that commit, but currently we do.)

Make sure that the context manager *is* used, and remove the `server.stop()`
calls from ConnectionHandler.
(cherry picked from commit c9cda1608edf7664c10f4f467e24591062c2fe62)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months ago[3.12] gh-126499: test_ssl: Don't assume err.reason is a string (GH-126501) (GH-126573)
Miss Islington (bot) [Mon, 11 Nov 2024 12:56:08 +0000 (13:56 +0100)] 
[3.12] gh-126499: test_ssl: Don't assume err.reason is a string (GH-126501) (GH-126573)

gh-126499: test_ssl: Don't assume err.reason is a string (GH-126501)

The skipping machinery called `getattr(err, "reason", "")` on an arbitrary
exception. As intermittent Buildbot failures show, sometimes it's set
to None.

Convert it to string for this specific check.
(cherry picked from commit 78ad7e632248dc989378cabeb797b9f3d940d9f2)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months ago[3.12] Add missing fullstop `.` to whatsnew/3.8.rst (GH-126553) (#126673)
Miss Islington (bot) [Mon, 11 Nov 2024 07:08:37 +0000 (08:08 +0100)] 
[3.12] Add missing fullstop `.` to whatsnew/3.8.rst (GH-126553) (#126673)

Add missing fullstop `.` to whatsnew/3.8.rst (GH-126553)
(cherry picked from commit 82269c7d580e1aad71ff11fe891cf7f97eb45703)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
11 months ago[3.12] gh-126664: Use `else` instead of `finally` in "The with statement" documentati...
Miss Islington (bot) [Mon, 11 Nov 2024 06:57:15 +0000 (07:57 +0100)] 
[3.12] gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665) (#126671)

gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)
(cherry picked from commit 25257d61cfccc3b4189f96390a5c4db73fd5302c)

Co-authored-by: vivodi <103735539+vivodi@users.noreply.github.com>
11 months ago[3.12] gh-117378: Clear up the NEWS entry wording (GH-126634) (#126669)
Miss Islington (bot) [Mon, 11 Nov 2024 06:48:23 +0000 (07:48 +0100)] 
[3.12] gh-117378: Clear up the NEWS entry wording (GH-126634) (#126669)

gh-117378: Clear up the NEWS entry wording (GH-126634)

gh-117378: Clear up the NEWS entry wording.

Docs are hard.  Lets go shopping!
(cherry picked from commit 5c488caeb858690a696bc9f74fc74a274a3aa51c)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 months ago[3.12] gh-126543: Docs: change "bound type var" to "bounded" when used in the context...
Miss Islington (bot) [Mon, 11 Nov 2024 02:52:20 +0000 (03:52 +0100)] 
[3.12] gh-126543: Docs: change "bound type var" to "bounded" when used in the context of the 'bound' kw argument to TypeVar (GH-126584) (#126658)

(cherry picked from commit 434b29767f2fdef9f35c8e93303cf6aca4a66a80)

Co-authored-by: Pedro Fonini <fonini@protonmail.ch>
11 months ago[3.12] gh-117378: Only run the new multiprocessing SysPath test when appropriate...
Miss Islington (bot) [Sun, 10 Nov 2024 21:33:26 +0000 (22:33 +0100)] 
[3.12] gh-117378: Only run the new multiprocessing SysPath test when appropriate (GH-126635) (GH-126653)

gh-117378: Only run the new multiprocessing SysPath test when appropriate (GH-126635)

The first version had it running two forkserver and one spawn tests underneath each of the _fork, _forkserver, and _spawn test suites that build off the generic one.

This adds to the existing complexity of the multiprocessing test suite by offering BaseTestCase classes another attribute to control which suites they are invoked under. Practicality vs purity here. :/

Net result: we don't over-run the new test and their internal logic is simplified.
(cherry picked from commit ca878b6e45f9c7934842f7bb94274e671b155e09)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
11 months ago[3.12] Skip test in test_socket.py if `sys.getrefcount` isn't available (GH-126640...
Miss Islington (bot) [Sun, 10 Nov 2024 15:34:52 +0000 (16:34 +0100)] 
[3.12] Skip test in test_socket.py if `sys.getrefcount` isn't available (GH-126640) (#126646)

Skip test in test_socket.py if `sys.getrefcount` isn't available (GH-126640)

Skip `testMakefileCloseSocketDestroy` test if `sys.getrefcount` isn't available. This is necessary for  PyPy and other Python implementations that do not have `sys.getrefcount`.
(cherry picked from commit 0f6bb28ff3ba152faf7523ea9aaf0094cc39bdda)

Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
11 months ago[3.12] gh-126565: Skip `zipfile.Path.exists` check in write mode (GH-126576) (#126643)
Miss Islington (bot) [Sun, 10 Nov 2024 15:14:48 +0000 (16:14 +0100)] 
[3.12] gh-126565: Skip `zipfile.Path.exists` check in write mode (GH-126576) (#126643)

gh-126565: Skip `zipfile.Path.exists` check in write mode (GH-126576)

When `zipfile.Path.open` is called, the implementation will check
whether the path already exists in the ZIP file. However, this check is
only required when the ZIP file is in read mode. By swapping arguments
of the `and` operator, the short-circuiting will prevent the check from
being run in write mode.

This change will improve the performance of `open()`, because checking
whether a file exists is slow in write mode, especially when the archive
has many members.
(cherry picked from commit 160758a574d12bf0d965d8206136e7da4f4fd6c3)

Co-authored-by: Jan Hicken <janhicken@users.noreply.github.com>
11 months ago[3.12] Postpone `module.__loader__` deprecation to Python 3.16 (GH-126482) (#126637)
Miss Islington (bot) [Sun, 10 Nov 2024 00:57:54 +0000 (01:57 +0100)] 
[3.12] Postpone `module.__loader__` deprecation to Python 3.16 (GH-126482) (#126637)

Postpone `module.__loader__` deprecation to Python 3.16 (GH-126482)
(cherry picked from commit 450db61a78989c5a1f1106be01e071798c783cf9)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months ago[3.12] gh-117378: Fix multiprocessing forkserver preload sys.path inheritance. (GH...
Gregory P. Smith [Sun, 10 Nov 2024 00:13:26 +0000 (16:13 -0800)] 
[3.12] gh-117378: Fix multiprocessing forkserver preload sys.path inheritance. (GH-126538) (GH-126633)

gh-117378: Fix multiprocessing forkserver preload sys.path inheritance.

`sys.path` was not properly being sent from the parent process when launching
the multiprocessing forkserver process to preload imports.  This bug has been
there since the forkserver start method was introduced in Python 3.4.  It was
always _supposed_ to inherit `sys.path` the same way the spawn method does.

Observable behavior change: A `''` value in `sys.path` will now be replaced in
the forkserver's `sys.path` with an absolute pathname
`os.path.abspath(os.getcwd())` saved at the time that `multiprocessing` was
imported in the parent process as it already was when using the spawn start
method. **This will only be observable during forkserver preload imports**.

The code invoked before calling things in another process already correctly sets `sys.path`.
Which is likely why this went unnoticed for so long as a mere performance issue in
some configurations.

A workaround for the bug on impacted Pythons is to set PYTHONPATH in the
environment before multiprocessing's forkserver process was started. Not perfect
as that is then inherited by other children, etc, but likely good enough for many
people's purposes.

(cherry picked from commit 9d08423b6e0fa89ce9cfea08e580ed72e5db8c70)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
12 months ago[3.12] GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214) (#126591)
Miss Islington (bot) [Fri, 8 Nov 2024 17:21:42 +0000 (18:21 +0100)] 
[3.12] GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214) (#126591)

GH-126212: Fix removal of slashes in file URIs on Windows (GH-126214)

Adjust `urllib.request.pathname2url()` and `url2pathname()` so that they
don't remove slashes from Windows DOS drive paths and URLs. There was no
basis for this behaviour, and it conflicts with how UNC and POSIX paths are
handled.
(cherry picked from commit 54c63a32d06cb5f07a66245c375eac7d7efb964a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
12 months agogh-125298: Remove misleading text in os.kill documentation (GH-125749)
Miss Islington (bot) [Fri, 8 Nov 2024 15:47:46 +0000 (16:47 +0100)] 
gh-125298: Remove misleading text in os.kill documentation (GH-125749)

Windows has not accepted process handles in many releases.
(cherry picked from commit 75ffac296ef24758b7e5bd9316f32a8170ade37f)

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
12 months ago[3.12] gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566...
Miss Islington (bot) [Fri, 8 Nov 2024 10:56:08 +0000 (11:56 +0100)] 
[3.12] gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566) (#126568)

gh-126171: fix possible null dereference in _imp_find_frozen_impl (GH-126566)
(cherry picked from commit 9ecd8f7f40e6724a1c1d46c2665147aaabceb2d2)

Co-authored-by: Valery Fedorenko <federicovalenso@gmail.com>
12 months ago[3.12] Doc: C API: Demote sections to subsections for consistency (GH-126535) (#126545)
Miss Islington (bot) [Thu, 7 Nov 2024 15:38:57 +0000 (16:38 +0100)] 
[3.12] Doc: C API: Demote sections to subsections for consistency (GH-126535) (#126545)

Doc: C API: Demote sections to subsections for consistency (GH-126535)

The entire file should be a single section; the headings below the
first heading should be subsections.
(cherry picked from commit e3510bd3dd9ea8f2a30cb1128470aee3a48d8880)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
12 months ago[3.12] gh-125679: multiprocessing Lock and RLock - fix invalid representation string...
Miss Islington (bot) [Thu, 7 Nov 2024 09:50:46 +0000 (10:50 +0100)] 
[3.12] gh-125679: multiprocessing Lock and RLock - fix invalid representation string on MacOSX. (GH-125680) (#126534)

gh-125679: multiprocessing Lock and RLock - fix invalid representation string on MacOSX. (GH-125680)
(cherry picked from commit 75f7cf91ec5afc6091a0fd442a1f0435c19300b2)

Co-authored-by: Duprat <yduprat@gmail.com>
12 months ago[3.12] gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452...
Miss Islington (bot) [Wed, 6 Nov 2024 22:37:37 +0000 (23:37 +0100)] 
[3.12] gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452) (#126519)

gh-126451: Register contextvars.Context to collections.abc.Mapping (GH-126452)
(cherry picked from commit 5dc36dc5658f6ba9cfd9d7a2771baaf17d2ee23a)

Co-authored-by: Stephen Morton <git@tungol.org>
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months ago[3.12] gh-126489: Do not call persistent_id() for a persistent id in Python pickle...
Serhiy Storchaka [Wed, 6 Nov 2024 21:11:37 +0000 (23:11 +0200)] 
[3.12] gh-126489: Do not call persistent_id() for a persistent id in Python pickle (GH-126490) (GH-126516)

(cherry picked from commit 8fa4dc4ba8646c59f945f2451c53e2919f066065)

12 months ago[3.12] gh-126461: Fix _Unpickler_ReadFromFile() error handling (GH-126485) (#126496)
Miss Islington (bot) [Wed, 6 Nov 2024 13:49:25 +0000 (14:49 +0100)] 
[3.12] gh-126461: Fix _Unpickler_ReadFromFile() error handling (GH-126485) (#126496)

gh-126461: Fix _Unpickler_ReadFromFile() error handling (GH-126485)

Handle _Unpickler_SetStringInput() failure.
(cherry picked from commit a1c57bcfd2bcbc55ff858407e09c1d8d8cee44e6)

Co-authored-by: Victor Stinner <vstinner@python.org>
12 months ago[3.12] gh-126455: Disallow _ssl.SSLSocket instantiation (GH-126481) (#126487)
Miss Islington (bot) [Wed, 6 Nov 2024 11:21:21 +0000 (12:21 +0100)] 
[3.12] gh-126455: Disallow _ssl.SSLSocket instantiation (GH-126481) (#126487)

gh-126455: Disallow _ssl.SSLSocket instantiation (GH-126481)

Prevent creation of incomplete/invalid _ssl.SSLSocket objects when
created directly.
(cherry picked from commit b1c4ffc20573befb4db66bbbdd569b9bd13bb127)

Co-authored-by: Victor Stinner <vstinner@python.org>
12 months ago[3.12] gh-122544: Change OS image in Azure pipeline to Ubuntu 24.04 (GH-125344) ...
Miss Islington (bot) [Wed, 6 Nov 2024 10:18:02 +0000 (11:18 +0100)] 
[3.12] gh-122544: Change OS image in Azure pipeline to Ubuntu 24.04 (GH-125344) (#126480)

Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
12 months ago[3.12] Fix possible null pointer dereference of freevars in _PyCompile_LookupArg...
Valery Fedorenko [Wed, 6 Nov 2024 07:56:12 +0000 (10:56 +0300)] 
[3.12] Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (gh-126238) (#126474)

[3.12] gh-126238: Fix possible null pointer dereference of freevars in _PyCompile_LookupArg (GH-126239)

* Replace Py_DECREF by Py_XDECREF

(cherry picked from commit 8525c9375f25e6ec0c0b5dfcab464703f6e78082)

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months ago[3.12] gh-70764: inspect.getclosurevars now identifies global variables with LOAD_GLO...
Miss Islington (bot) [Wed, 6 Nov 2024 00:12:08 +0000 (01:12 +0100)] 
[3.12] gh-70764: inspect.getclosurevars now identifies global variables with LOAD_GLOBAL (GH-120143) (#126460)

gh-70764: inspect.getclosurevars now identifies global variables with LOAD_GLOBAL (GH-120143)
(cherry picked from commit 83ba8c2bba834c0b92de669cac16fcda17485e0e)

Co-authored-by: blhsing <blhsing@gmail.com>
12 months ago[3.12] gh-89640: harden float word ordering (#125571 and #126387) (#126430)
Erlend E. Aasland [Tue, 5 Nov 2024 22:19:13 +0000 (23:19 +0100)] 
[3.12] gh-89640: harden float word ordering (#125571 and #126387) (#126430)

Properly detect float word ordering on Linux (gh-125571)

autoconf-archive patch by Dan Amelang.

(cherry picked from commit 26d627779f79d8d5650fe7be348432eccc28f8f9)

Hardcode WASM float word ordering to little endian (gh-126387)

(cherry picked from commit 532fc08102d62c04d55f5b8aac00bd9e7e12ff4b)

12 months ago[3.12] gh-126425: Refactor `_lsprof_Profiler_enable` (GH-126426) (#126443)
Miss Islington (bot) [Tue, 5 Nov 2024 12:42:33 +0000 (13:42 +0100)] 
[3.12] gh-126425: Refactor `_lsprof_Profiler_enable` (GH-126426) (#126443)

gh-126425: Refactor `_lsprof_Profiler_enable` (GH-126426)

- Explicit memory management for `None` objects (since we still try to treat immortal objects as regular objects)
- Respect possible errors of `sys.monitoring.register_callback` call
(cherry picked from commit 75872605aa78dbdfc5c4f025b0f90a7f37ba10c3)

Co-authored-by: sobolevn <mail@sobolevn.me>
12 months ago[3.12] gh-126417: Register multiprocessing proxy types to an appropriate collections...
Alex Waygood [Tue, 5 Nov 2024 11:19:45 +0000 (11:19 +0000)] 
[3.12] gh-126417: Register multiprocessing proxy types to an appropriate collections.abc class (#126419) (#126436)

Co-authored-by: Stephen Morton <github@tungol.org>
12 months ago[3.12] Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418) (#126432)
Miss Islington (bot) [Tue, 5 Nov 2024 10:01:37 +0000 (11:01 +0100)] 
[3.12] Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418) (#126432)

Doc: C API: Delete claim that `PyObject_Init` is GC-aware (GH-126418)
(cherry picked from commit 407c0366d9ccd2a36c6cc8bf92324856b16fd604)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
12 months ago[3.12] gh-126303: Fix pickling and copying of os.sched_param objects (GH-126336)...
Serhiy Storchaka [Tue, 5 Nov 2024 06:52:51 +0000 (08:52 +0200)] 
[3.12] gh-126303: Fix pickling and copying of os.sched_param objects (GH-126336) (GH-126424)

(cherry picked from commit d3840503b0f590ee574fbdf3c96626ff8b3c45f6)

12 months ago[3.12] gh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (GH-126392)...
Hugo van Kemenade [Mon, 4 Nov 2024 17:47:40 +0000 (19:47 +0200)] 
[3.12] gh-101865: Docs: Keep co_lnotab deprecation for at least 3.14 (GH-126392) (#126404)

(cherry picked from commit eac41c5ddfadf52fbd84ee898ad56aedd5d90a41)

12 months ago[3.12] gh-125783: Add more tests to prevent regressions with the combination of ctype...
Miss Islington (bot) [Mon, 4 Nov 2024 10:58:30 +0000 (11:58 +0100)] 
[3.12] gh-125783: Add more tests to prevent regressions with the combination of ctypes and metaclasses. (GH-126126) (GH-126276)

gh-125783: Add more tests to prevent regressions with the combination of ctypes and metaclasses. (GH-126126)
(cherry picked from commit 6c67446a6e73ab0e9a26e4360412cbd2f5550e66)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
12 months ago[3.12] Docs: turn getopt examples into doctests (GH-126377) (#126386)
Miss Islington (bot) [Mon, 4 Nov 2024 08:37:23 +0000 (09:37 +0100)] 
[3.12] Docs: turn getopt examples into doctests (GH-126377) (#126386)

(cherry picked from commit 0d80777981f95bbc79b146fc78b2189c82521ab9)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
12 months ago[3.12] gh-126165: Improve docs of function `math.isclose` (GH-126215) (#126381)
Miss Islington (bot) [Mon, 4 Nov 2024 04:16:35 +0000 (05:16 +0100)] 
[3.12] gh-126165: Improve docs of function `math.isclose` (GH-126215) (#126381)

gh-126165: Improve docs of function `math.isclose` (GH-126215)
(cherry picked from commit 081706f873b7d1a10b27016a9ed350b20c719709)

Co-authored-by: Zhikang Yan <2951256653@qq.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
12 months ago[3.12] Docs: Delist sqlite3 deprecation from "Pending removal in 3.14" (GH-126370...
Miss Islington (bot) [Sun, 3 Nov 2024 21:31:59 +0000 (22:31 +0100)] 
[3.12] Docs: Delist sqlite3 deprecation from "Pending removal in 3.14" (GH-126370) (#126373)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
12 months ago[3.12] gh-104400: Add more tests to pygettext (GH-108173) (GH-126362)
Miss Islington (bot) [Sun, 3 Nov 2024 14:24:41 +0000 (15:24 +0100)] 
[3.12] gh-104400: Add more tests to pygettext (GH-108173) (GH-126362)

(cherry picked from commit dcae5cd6abaae4f73e656ebc054f30d3f15ca7b8)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
12 months ago[3.12] gh-113977, gh-120754: Remove unbounded reads from zipfile (GH-122101) (#126347)
Miss Islington (bot) [Sun, 3 Nov 2024 05:48:19 +0000 (06:48 +0100)] 
[3.12] gh-113977, gh-120754: Remove unbounded reads from zipfile (GH-122101) (#126347)

gh-113977, gh-120754: Remove unbounded reads from zipfile (GH-122101)

GH-113977, GH-120754: Remove unbounded reads from zipfile

Read without a size may read an unbounded amount of data + allocate
unbounded size buffers. Move to capped size reads to prevent potential
issues.

(cherry picked from commit 556dc9b8a78bad296513221f3f414a3f8fd0ae70)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
Co-authored-by: Daniel Hillier <daniel.hillier@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
12 months ago[3.12] gh-125832: Clarify comment for inlined comprehensions as per P… (gh-126345)
Donghee Na [Sun, 3 Nov 2024 04:00:52 +0000 (13:00 +0900)] 
[3.12] gh-125832: Clarify comment for inlined comprehensions as per P… (gh-126345)

* [3.12] gh-125832: Clarify comment for inlined comprehensions as per PEP-709 (gh-126322)

* Fix comprehensions comment to inlined by pep 709

* Update spacing

Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* Add reference to PEP 709

---------

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
* Add space

---------

Co-authored-by: rimchoi <hyerimc858@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
12 months ago[3.12] gh-125761: Clarify repeated warning suppression criteria in warnings module...
Miss Islington (bot) [Sat, 2 Nov 2024 11:45:36 +0000 (12:45 +0100)] 
[3.12] gh-125761: Clarify repeated warning suppression criteria in warnings module (gh-126331)

(cherry picked from commit 10eeec2d4ffb6b09a6d925877b6d9ef6aa6bb59d)

Co-authored-by: 고병찬 <70642609+byungchanKo99@users.noreply.github.com>
12 months ago[3.12] gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321) (gh-126328)
Miss Islington (bot) [Sat, 2 Nov 2024 08:49:32 +0000 (09:49 +0100)] 
[3.12] gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321) (gh-126328)

gh-125522: Remove bare except in test_zlib.test_flushes (gh-126321)
(cherry picked from commit cfb1b2f0cb999558a30e61a9e1a62fdb7f55f6a4)

Co-authored-by: simple-is-great <103080930+simple-is-great@users.noreply.github.com>
12 months ago[3.12] gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__...
Miss Islington (bot) [Sat, 2 Nov 2024 08:03:51 +0000 (09:03 +0100)] 
[3.12] gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` (GH-126305) (#126325)

gh-126138: Fix use-after-free in `_asyncio.Task` by evil `__getattribute__` (GH-126305)
(cherry picked from commit f032f6ba8fec6fab35edeec0eb40cd73e9d58928)

Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
12 months ago[3.12] docs: add a more precise example in enum doc (GH-121015) (#126307)
Miss Islington (bot) [Fri, 1 Nov 2024 23:18:00 +0000 (00:18 +0100)] 
[3.12] docs: add a more precise example in enum doc (GH-121015) (#126307)

docs: add a more precise example in enum doc (GH-121015)

* docs: add a more precise example

Previous example used manual integer value assignment in class based declaration but in functional syntax has been used auto value assignment what could be confusing for the new users. Additionally documentation doesn't show how to declare new enum via functional syntax with usage of the manual value assignment.

* docs: remove whitespace characters

* refactor: change example

---------

(cherry picked from commit ff257c7843d8ed0dffb6624f2f14996a46e74801)

Co-authored-by: Filip "Ret2Me" Poplewski <37419029+Ret2Me@users.noreply.github.com>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
12 months ago[3.12] gh-126220: Fix crash on calls to `_lsprof.Profiler` methods with 0 args (backp...
Miss Islington (bot) [Fri, 1 Nov 2024 22:18:50 +0000 (23:18 +0100)] 
[3.12] gh-126220: Fix crash on calls to `_lsprof.Profiler` methods with 0 args (backportable) (GH-126271) (#126311)

gh-126220: Fix crash on calls to `_lsprof.Profiler` methods with 0 args (backportable) (GH-126271)
(cherry picked from commit 28b148fb32e4548b461137d18d1ab6d366395d36)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
12 months ago[3.12] gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778) (GH-123904)
Miss Islington (bot) [Fri, 1 Nov 2024 19:38:23 +0000 (20:38 +0100)] 
[3.12] gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778) (GH-123904)

gh-123609: Clarify usage of standalone `PyBUF_FORMAT` (GH-123778)
(cherry picked from commit 962304a54ca79da0838cf46dd4fb744045167cdd)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
12 months ago[3.12] Docs: make a tutorial example more precise (GH-125066) (GH-125079)
Miss Islington (bot) [Fri, 1 Nov 2024 19:36:51 +0000 (20:36 +0100)] 
[3.12] Docs: make a tutorial example more precise (GH-125066) (GH-125079)

Docs: make a tutorial example more precise (GH-125066)

Based on discussion here:

(cherry picked from commit 6e3c70c61bf961e55e9912a31ca11f61c8e2cd0c)

https: //discuss.python.org/t/omission-in-the-documentation/66816

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
12 months ago[3.12] gh-122767: document "new style" formatting for complexes (GH-122848) (#126129)
Miss Islington (bot) [Fri, 1 Nov 2024 19:29:53 +0000 (20:29 +0100)] 
[3.12] gh-122767: document "new style" formatting for complexes (GH-122848) (#126129)

gh-122767: document "new style" formatting for complexes (GH-122848)

(cherry picked from commit 0bbbe15f5688552236c48f2b6e320c5312720b8e)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
12 months ago[3.12] gh-126259: Fix "unclosed database" warning in sqlite3 doctest (GH-126260)...
Miss Islington (bot) [Fri, 1 Nov 2024 07:25:51 +0000 (08:25 +0100)] 
[3.12] gh-126259: Fix "unclosed database" warning in sqlite3 doctest (GH-126260) (#126266)

(cherry picked from commit 295262c8ecb085b4fea552bc6229af3551bbaf7a)

Co-authored-by: sobolevn <mail@sobolevn.me>
12 months ago[3.12] gh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to...
Miss Islington (bot) [Thu, 31 Oct 2024 19:33:48 +0000 (20:33 +0100)] 
[3.12] gh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to an evil `loop.__getattribute__` (GH-126120) (#126251)

gh-126080: fix UAF on `task->task_context` in `task_call_step_soon` due to an evil `loop.__getattribute__` (GH-126120)
(cherry picked from commit 0e8665554b2f1334e530fd6de5b3a4e908405419)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>