]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
11 months agoGH-126892: Reset warmup counters when JIT compiling code (GH-126893)
Brandt Bucher [Wed, 20 Nov 2024 16:11:25 +0000 (08:11 -0800)] 
GH-126892: Reset warmup counters when JIT compiling code (GH-126893)

11 months agogh-126991: Add tests for unpickling bad object state (GH-127031)
Serhiy Storchaka [Wed, 20 Nov 2024 15:31:50 +0000 (17:31 +0200)] 
gh-126991: Add tests for unpickling bad object state (GH-127031)

This catches a memory leak in loading the BUILD opcode.

11 months agogh-126615: `ctypes`: Make `COMError` public (GH-126686)
Jun Komoda [Wed, 20 Nov 2024 12:53:43 +0000 (21:53 +0900)] 
gh-126615: `ctypes`: Make `COMError` public (GH-126686)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months agoGH-84850: Improve whatsnew entry for `[Fancy]URLopener` removal (#127032)
Barney Gale [Wed, 20 Nov 2024 11:14:07 +0000 (11:14 +0000)] 
GH-84850: Improve whatsnew entry for `[Fancy]URLopener` removal (#127032)

11 months agogh-123299: Copyedit "What's New in Python 3.14" (#127028)
Hugo van Kemenade [Wed, 20 Nov 2024 09:35:24 +0000 (11:35 +0200)] 
gh-123299: Copyedit "What's New in Python 3.14" (#127028)

11 months agoDoc: C API: `PyThreadState::on_delete` was removed in v3.13 (#126536)
Richard Hansen [Wed, 20 Nov 2024 08:44:45 +0000 (03:44 -0500)] 
Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (#126536)

11 months agoGH-85168: Use filesystem encoding when converting to/from `file` URIs (#126852)
Barney Gale [Tue, 19 Nov 2024 21:19:30 +0000 (21:19 +0000)] 
GH-85168: Use filesystem encoding when converting to/from `file` URIs (#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.

11 months agoMerge remote-tracking branch 'upstream/main'
Hugo van Kemenade [Tue, 19 Nov 2024 20:10:24 +0000 (22:10 +0200)] 
Merge remote-tracking branch 'upstream/main'

11 months agogh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterState...
Eric Snow [Tue, 19 Nov 2024 19:59:19 +0000 (12:59 -0700)] 
gh-126914: Store the Preallocated Thread State's Pointer in a PyInterpreterState Field (gh-126989)

This approach eliminates the originally reported race. It also gets rid of the deadlock reported in gh-96071, so we can remove the workaround added then.

11 months agoPost 3.14.0a2
Hugo van Kemenade [Tue, 19 Nov 2024 19:55:02 +0000 (21:55 +0200)] 
Post 3.14.0a2

11 months agogh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest...
sobolevn [Tue, 19 Nov 2024 19:41:59 +0000 (22:41 +0300)] 
gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest` (#127033)

11 months agogh-126947: Typechecking for _pydatetime.timedelta.__new__ arguments (#126949)
Beomsoo Kim [Tue, 19 Nov 2024 19:40:52 +0000 (04:40 +0900)] 
gh-126947: Typechecking for _pydatetime.timedelta.__new__ arguments (#126949)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
11 months agogh-125729: Makes the installation of the turtle module dependent on the Tcl/Tk instal...
CoderTCY [Tue, 19 Nov 2024 17:19:33 +0000 (01:19 +0800)] 
gh-125729: Makes the installation of the turtle module dependent on the Tcl/Tk install option  (GH-126176)

11 months agogh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990)
Justin Applegate [Tue, 19 Nov 2024 16:00:35 +0000 (11:00 -0500)] 
gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990)

If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable.

11 months agogh-118201: Simplify conv_confname (#126089)
Malcolm Smith [Tue, 19 Nov 2024 15:42:19 +0000 (15:42 +0000)] 
gh-118201: Simplify conv_confname (#126089)

11 months agoUpdate docs 'make serve' to suggest 'make htmllive' (#126969)
Hugo van Kemenade [Tue, 19 Nov 2024 15:28:34 +0000 (17:28 +0200)] 
Update docs 'make serve' to suggest 'make htmllive' (#126969)

11 months agoPython 3.14.0a2 v3.14.0a2
Hugo van Kemenade [Tue, 19 Nov 2024 14:51:57 +0000 (16:51 +0200)] 
Python 3.14.0a2

11 months agogh-126980: Fix `bytearray.__buffer__` crash on `PyBUF_{READ,WRITE}` (#126981)
sobolevn [Tue, 19 Nov 2024 14:44:53 +0000 (17:44 +0300)] 
gh-126980: Fix `bytearray.__buffer__` crash on `PyBUF_{READ,WRITE}` (#126981)

Co-authored-by: Victor Stinner <vstinner@python.org>
11 months agoGH-84850: Remove `urllib.request.URLopener` and `FancyURLopener` (#125739)
Barney Gale [Tue, 19 Nov 2024 14:01:49 +0000 (14:01 +0000)] 
GH-84850: Remove `urllib.request.URLopener` and `FancyURLopener` (#125739)

11 months agoGH-124567: Replace quadratic assert with linear one (GH-127009)
Mark Shannon [Tue, 19 Nov 2024 13:38:59 +0000 (13:38 +0000)] 
GH-124567: Replace quadratic assert with linear one (GH-127009)

11 months agocodeowners: add myself to getpath, site, and venv (#126994)
Filipe Laíns 🇵🇸 [Tue, 19 Nov 2024 12:43:34 +0000 (12:43 +0000)] 
codeowners: add myself to getpath, site, and venv (#126994)

Signed-off-by: Filipe Laíns <lains@riseup.net>
11 months agogh-126076: Account for relocated objects in tracemalloc (#126077)
Pablo Galindo Salgado [Tue, 19 Nov 2024 10:35:17 +0000 (10:35 +0000)] 
gh-126076: Account for relocated objects in tracemalloc (#126077)

11 months agoRevert "GH-126491: GC: Mark objects reachable from roots before doing cycle collectio...
Hugo van Kemenade [Tue, 19 Nov 2024 09:25:09 +0000 (11:25 +0200)] 
Revert "GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-126502)" (#126983)

11 months agogh-126594: Fix typeobject.c wrap_buffer() cast (#126754)
Victor Stinner [Tue, 19 Nov 2024 08:13:20 +0000 (09:13 +0100)] 
gh-126594: Fix typeobject.c wrap_buffer() cast (#126754)

Reject flags smaller than INT_MIN.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
11 months agogh-126876: Fix socket internal_select() for large timeout (#126968)
Victor Stinner [Tue, 19 Nov 2024 08:08:42 +0000 (09:08 +0100)] 
gh-126876: Fix socket internal_select() for large timeout (#126968)

If the timeout is larger than INT_MAX, replace it with INT_MAX, in
the poll() code path.

Add an unit test.

11 months agogh-126986: Drop _PyInterpreterState_FailIfNotRunning() (gh-126988)
Eric Snow [Tue, 19 Nov 2024 00:11:12 +0000 (17:11 -0700)] 
gh-126986: Drop _PyInterpreterState_FailIfNotRunning() (gh-126988)

We replace it with _PyErr_SetInterpreterAlreadyRunning().

11 months agogetpath: fix warning typo (#126978)
Filipe Laíns 🇵🇸 [Mon, 18 Nov 2024 23:50:01 +0000 (23:50 +0000)] 
getpath: fix warning typo (#126978)

11 months agoGH-126795: Increase the JIT threshold from 16 to 4096 (GH-126816)
Brandt Bucher [Mon, 18 Nov 2024 19:11:23 +0000 (11:11 -0800)] 
GH-126795: Increase the JIT threshold from 16 to 4096 (GH-126816)

11 months agogh-85957: Add missing MIME types for images with RFCs (#126966)
Hugo van Kemenade [Mon, 18 Nov 2024 18:13:20 +0000 (20:13 +0200)] 
gh-85957: Add missing MIME types for images with RFCs (#126966)

11 months agogh-123803: Support arbitrary code page encodings on Windows (GH-123804)
Serhiy Storchaka [Mon, 18 Nov 2024 17:45:25 +0000 (19:45 +0200)] 
gh-123803: Support arbitrary code page encodings on Windows (GH-123804)

If the cpXXX encoding is not directly implemented in Python, fall back
to use the Windows-specific API codecs.code_page_encode() and
codecs.code_page_decode().

11 months agogh-126911: Update credits output (#126913)
Stan U. [Mon, 18 Nov 2024 15:29:14 +0000 (15:29 +0000)] 
gh-126911: Update credits output (#126913)

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 agoGH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH...
Mark Shannon [Mon, 18 Nov 2024 14:31:26 +0000 (14:31 +0000)] 
GH-126491: GC: Mark objects reachable from roots before doing cycle collection (GH-126502)

* Mark almost all reachable objects before doing collection phase

* Add stats for objects marked

* Visit new frames before each increment

* Remove lazy dict tracking

* Update docs

* Clearer calculation of work to do.

11 months agogh-109413: Enable `strict_optional = true` for `libregrtest/run_workers` (#126855)
sobolevn [Mon, 18 Nov 2024 14:23:43 +0000 (17:23 +0300)] 
gh-109413: Enable `strict_optional = true` for `libregrtest/run_workers` (#126855)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
11 months agogh-126909: Fix running xattr tests on systems with lower limits (#126930)
Michał Górny [Mon, 18 Nov 2024 13:05:55 +0000 (13:05 +0000)] 
gh-126909: Fix running xattr tests on systems with lower limits (#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.

11 months agogh-101955: Fix SystemError in possesive quantifier with alternative and group (GH...
Serhiy Storchaka [Mon, 18 Nov 2024 11:43:44 +0000 (13:43 +0200)] 
gh-101955: Fix SystemError in possesive quantifier with alternative and group (GH-111362)

Co-authored-by: <wjssz@users.noreply.github.com>
11 months agogh-67877: Fix memory leaks in terminated RE matching (GH-126840)
Serhiy Storchaka [Mon, 18 Nov 2024 09:53:45 +0000 (11:53 +0200)] 
gh-67877: Fix memory leaks in terminated RE matching (GH-126840)

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

Co-authored-by: <wjssz@users.noreply.github.com>
11 months agogh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941)
Russell Keith-Magee [Mon, 18 Nov 2024 08:50:40 +0000 (16:50 +0800)] 
gh-126789: Correct sysconfig test exclusions for iOS and Android. (GH-126941)

11 months agoDoc: Reorganize math module documentation (#126337)
Joseph Martinot-Lagarde [Mon, 18 Nov 2024 07:57:32 +0000 (08:57 +0100)] 
Doc: Reorganize math module documentation (#126337)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months agogh-126167: Modify iOS Testbed to read arguments from Info.plist (#126169)
Russell Keith-Magee [Sun, 17 Nov 2024 23:43:41 +0000 (07:43 +0800)] 
gh-126167: Modify iOS Testbed to read arguments from Info.plist (#126169)

Modify iOS Testbed to read arguments from Info.plist.

11 months agogh-126896: Fix docs about `asyncio.start_server()` (#126897)
beavailable [Sun, 17 Nov 2024 19:32:35 +0000 (03:32 +0800)] 
gh-126896: Fix docs about `asyncio.start_server()` (#126897)

11 months agoGH-126920: fix Makefile overwriting sysconfig.get_config_vars
Filipe Laíns 🇵🇸 [Sun, 17 Nov 2024 01:56:01 +0000 (01:56 +0000)] 
GH-126920: fix Makefile overwriting sysconfig.get_config_vars

11 months agoGH-126789: fix some sysconfig data on late site initializations
Filipe Laíns 🇵🇸 [Sun, 17 Nov 2024 00:07:25 +0000 (00:07 +0000)] 
GH-126789: fix some sysconfig data on late site initializations

11 months agogh-124452: Fix header mismatches when folding/unfolding with email message (#125919)
RanKKI [Sat, 16 Nov 2024 23:01:52 +0000 (10:01 +1100)] 
gh-124452: Fix header mismatches when folding/unfolding with email message (#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.

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 agoGH-126748: amend configure.rst description for the 'build_wasm' make target (#126687)
Hood Chatham [Sat, 16 Nov 2024 01:46:39 +0000 (02:46 +0100)] 
GH-126748: amend configure.rst description for the 'build_wasm' make target (#126687)

Clarified the documentation around how the build_wasm target is selected.

11 months agogh-126691: Remove --with-emscripten-target (#126787)
Hood Chatham [Sat, 16 Nov 2024 01:44:05 +0000 (02:44 +0100)] 
gh-126691: Remove --with-emscripten-target (#126787)

This unifies the code for nodejs and the code for the browser. After this
commit, the browser example doesn't work; this will be fixed in a
subsequent update.

11 months agoAdded a warning to the urljoin docs, indicating that it is not safe to use with attac...
Alex Gaynor [Fri, 15 Nov 2024 23:09:05 +0000 (18:09 -0500)] 
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.

11 months agoDocs: Miscellaneous corrections to simple statements in the language reference (GH...
Beomsoo Kim [Fri, 15 Nov 2024 21:02:34 +0000 (06:02 +0900)] 
Docs: Miscellaneous corrections to simple statements in the language reference (GH-126720)

* Replace: The :keyword:`global` -> The :keyword:`global` statement
Add :keyword: when it's needed

* Replace repeated links with duoble backticks

11 months agogh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month...
Nadeshiko Manju [Fri, 15 Nov 2024 19:03:06 +0000 (03:03 +0800)] 
gh-126476: Raise IllegalMonthError for calendar.formatmonth() when the input month is not correct (GH-126484)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
11 months agoAdd PEP 761 to What's New (#126550)
Seth Michael Larson [Fri, 15 Nov 2024 15:54:56 +0000 (09:54 -0600)] 
Add PEP 761 to What's New (#126550)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months agogh-122549: Add platform.invalidate_caches() (#122547)
Bénédikt Tran [Fri, 15 Nov 2024 13:52:56 +0000 (14:52 +0100)] 
gh-122549: Add platform.invalidate_caches() (#122547)

Allow to invalidate platform's cached results.

11 months agoFix intermittent failures for the `PyUnstable_Object_EnableDeferredRefcount` tests...
Peter Bierma [Fri, 15 Nov 2024 13:03:46 +0000 (08:03 -0500)] 
Fix intermittent failures for the `PyUnstable_Object_EnableDeferredRefcount` tests (GH-126849)

Hotfix for the PyUnstable_Object_EnableDeferredRefcount tests.

11 months agogh-125063: marshal: Add version 5, improve documentation (GH-126829)
Petr Viktorin [Fri, 15 Nov 2024 12:48:57 +0000 (13:48 +0100)] 
gh-125063: marshal: Add version 5, improve documentation (GH-126829)

* Document that slices can be marshalled
* Deduplicate and organize the list of supported types
  in docs
* Organize the type code list in marshal.c, to make
  it more obvious that this is a versioned format
* Back-fill some historical info

Co-authored-by: Michael Droettboom <mdboom@gmail.com>
11 months agogh-89083: small docs fixup for UUIDv8 (#126857)
Bénédikt Tran [Fri, 15 Nov 2024 12:26:38 +0000 (13:26 +0100)] 
gh-89083: small docs fixup for UUIDv8 (#126857)

11 months agogh-118973: Add _tkinter to freethreaded MSI (GH-126768)
Steve Dower [Fri, 15 Nov 2024 12:22:56 +0000 (12:22 +0000)] 
gh-118973: Add _tkinter to freethreaded MSI (GH-126768)

11 months agogh-126312: Don't traverse frozen objects on the free-threaded build (#126338)
Peter Bierma [Fri, 15 Nov 2024 10:21:30 +0000 (05:21 -0500)] 
gh-126312: Don't traverse frozen objects on the free-threaded build (#126338)

Also, _PyGC_Freeze() no longer freezes unreachable objects.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
11 months agogh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555)
George Alexopoulos [Fri, 15 Nov 2024 10:05:51 +0000 (12:05 +0200)] 
gh-126554: ctypes: Correctly handle NULL dlsym values (GH-126555)

For dlsym(), a return value of NULL does not necessarily indicate
an error [1].

Therefore, to avoid using stale (or NULL) dlerror() values, we must:

 1. clear the previous error state by calling dlerror()
 2. call dlsym()
 3. call dlerror()

If the return value of dlerror() is not NULL, an error occured.

In ctypes we choose to treat a NULL return value from dlsym()
as a "not found" error. This is the same as the fallback
message we use on Windows, Cygwin or when getting/formatting
the error reason fails.

[1]: https://man7.org/linux/man-pages/man3/dlsym.3.html

Signed-off-by: Georgios Alexopoulos <grgalex42@gmail.com>
Signed-off-by: Georgios Alexopoulos <grgalex@ba.uoa.gr>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
11 months agoGH-124567: Reduce overhead of debug build for GC. Should help CI performance (GH...
Mark Shannon [Fri, 15 Nov 2024 08:59:01 +0000 (08:59 +0000)] 
GH-124567: Reduce overhead of debug build for GC. Should help CI performance (GH-126777)

11 months agogh-103951: enable optimization for fast attribute access on module subclasses (GH...
Sergey B Kirpichev [Fri, 15 Nov 2024 08:03:38 +0000 (11:03 +0300)] 
gh-103951: enable optimization for fast attribute access on module subclasses (GH-126264)

Co-authored-by: Nicolas Tessore <n.tessore@ucl.ac.uk>
11 months agogh-126433: Update hacl-star (GH-126791)
Victor Stinner [Fri, 15 Nov 2024 00:22:50 +0000 (01:22 +0100)] 
gh-126433: Update hacl-star (GH-126791)

Retrieve the change: "Lib_Memzero0.c: Fix compiler warning on 32-bit Windows".

11 months agogh-126807: pygettext: Do not attempt to extract messages from function definitions...
Tomas R. [Thu, 14 Nov 2024 22:17:42 +0000 (23:17 +0100)] 
gh-126807: pygettext: Do not attempt to extract messages from function definitions. (GH-126808)

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.

11 months agoGH-126766: `url2pathname()`: handle empty authority section. (#126767)
Barney Gale [Thu, 14 Nov 2024 20:22:14 +0000 (20:22 +0000)] 
GH-126766: `url2pathname()`: handle empty authority section. (#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`.

11 months agogh-124111: Update tkinter for compatibility with Tcl/Tk 9.0.0 (GH-124156)
Marc Culler [Thu, 14 Nov 2024 18:45:08 +0000 (12:45 -0600)] 
gh-124111: Update tkinter for compatibility with Tcl/Tk 9.0.0 (GH-124156)

11 months agogh-126061: add new functions to `refcounts.dat` (#126788)
RUANG (James Roy) [Thu, 14 Nov 2024 14:04:38 +0000 (22:04 +0800)] 
gh-126061: add new functions to `refcounts.dat` (#126788)

11 months agoGH-117759: Update GC docs for incremental collection (GH-126695)
Mark Shannon [Thu, 14 Nov 2024 09:50:00 +0000 (09:50 +0000)] 
GH-117759: Update GC docs for incremental collection (GH-126695)

11 months agogh-123832: Adjust `socket.getaddrinfo` docs for better POSIX compliance (GH-126182)
Petr Viktorin [Thu, 14 Nov 2024 08:31:14 +0000 (09:31 +0100)] 
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.

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months agoDocument that return-less user-defined functions return None (#126769)
John Marshall [Thu, 14 Nov 2024 07:47:24 +0000 (20:47 +1300)] 
Document that return-less user-defined functions return None (#126769)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
11 months agoDoc: Recommend shlex.quote alongside pipes removal (#126570)
Colin Watson [Thu, 14 Nov 2024 05:01:35 +0000 (05:01 +0000)] 
Doc: Recommend shlex.quote alongside pipes removal (#126570)

One of the most common reasons I see the old `pipes` module still in use
when porting to Python 3.13 is for the undocumented `pipes.quote`
function, which can easily be replaced with `shlex.quote`.  I think it's
worth specifically calling this out, since being directed to the
`subprocess` module would be confusing in this case.

11 months agogh-126731: Update outdated project information in `pprint.pp` doc (#126732)
Wulian [Thu, 14 Nov 2024 04:58:06 +0000 (12:58 +0800)] 
gh-126731: Update outdated project information in `pprint.pp` doc (#126732)

11 months agoAdd Savannah to CODEOWNERS for argparse and the JIT (#126814)
Savannah Ostrowski [Wed, 13 Nov 2024 23:45:08 +0000 (15:45 -0800)] 
Add Savannah to CODEOWNERS for argparse and the JIT (#126814)

Add Savannah to CODEOWNERS

11 months agoGH-118289: Fix handling of non-directories in `posixpath.realpath()` (#120127)
Barney Gale [Wed, 13 Nov 2024 22:59:32 +0000 (22:59 +0000)] 
GH-118289: Fix handling of non-directories in `posixpath.realpath()` (#120127)

In strict mode, raise `NotADirectoryError` if we encounter a non-directory
while we still have path parts left to process.

We use a `part_count` variable rather than `len(rest)` because the `rest`
stack also contains markers for unresolved symlinks.

11 months agoGH-126606: don't write incomplete pyc files (GH-126627)
CF Bolz-Tereick [Wed, 13 Nov 2024 21:39:10 +0000 (22:39 +0100)] 
GH-126606: don't write incomplete pyc files (GH-126627)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Brett Cannon <brett@python.org>
11 months agogh-126188: Update bundled pip to 24.3.1 (gh-126805)
Stéphane Bidoul [Wed, 13 Nov 2024 20:58:57 +0000 (21:58 +0100)] 
gh-126188: Update bundled pip to 24.3.1 (gh-126805)

Update bundled pip to 24.3.1

11 months agogh-89640: Pull in update to float word order detection in autoconf-archive (#126747)
Hood Chatham [Wed, 13 Nov 2024 20:57:33 +0000 (21:57 +0100)] 
gh-89640: Pull in update to float word order detection in autoconf-archive (#126747)

11 months agogh-126390: Support for preserving order of options and nonoption arguments in gnu_get...
Serhiy Storchaka [Wed, 13 Nov 2024 20:50:46 +0000 (22:50 +0200)] 
gh-126390: Support for preserving order of options and nonoption arguments in gnu_getopt() (GH-126393)

11 months agogh-109413: Enable `strict_optional` for `libregrtest/main.py` (#126394)
sobolevn [Wed, 13 Nov 2024 19:29:28 +0000 (22:29 +0300)] 
gh-109413: Enable `strict_optional` for `libregrtest/main.py` (#126394)

11 months agogh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792)
Seth Michael Larson [Wed, 13 Nov 2024 18:31:20 +0000 (12:31 -0600)] 
gh-126623: Update libexpat to 2.6.4, make future updates easier (GH-126792)

Update libexpat to 2.6.4, make future updates easier.

11 months agogh-123465: Ensure PyType_FromMetaclass avoids extra strcmp (GH-125460)
neonene [Wed, 13 Nov 2024 17:09:26 +0000 (02:09 +0900)] 
gh-123465: Ensure PyType_FromMetaclass avoids extra strcmp (GH-125460)

use else

11 months agogh-126456: Fix _pyrepl curses tigetstr() (#126472)
Victor Stinner [Wed, 13 Nov 2024 16:46:10 +0000 (17:46 +0100)] 
gh-126456: Fix _pyrepl curses tigetstr() (#126472)

11 months agogh-123619: Add an unstable C API function for enabling deferred reference counting...
Peter Bierma [Wed, 13 Nov 2024 13:27:16 +0000 (08:27 -0500)] 
gh-123619: Add an unstable C API function for enabling deferred reference counting (GH-123635)

Co-authored-by: Sam Gross <colesbury@gmail.com>
11 months agogh-126175: Add attributes to TOMLDecodeError. Deprecate free-form `__init__` args...
Taneli Hukkinen [Wed, 13 Nov 2024 12:52:16 +0000 (14:52 +0200)] 
gh-126175: Add attributes to TOMLDecodeError. Deprecate free-form `__init__` args (GH-126428)

11 months agogh-126341: add release check to `__iter__` method of `memoryview` (#126759)
Ritvik Pasham [Wed, 13 Nov 2024 11:51:01 +0000 (06:51 -0500)] 
gh-126341: add release check to `__iter__` method of `memoryview` (#126759)

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 agogh-71936: Fix race condition in multiprocessing.Pool (GH-124973)
Petr Viktorin [Wed, 13 Nov 2024 09:25:10 +0000 (10:25 +0100)] 
gh-71936: Fix race condition in multiprocessing.Pool (GH-124973)

* gh-71936: Fix race condition in multiprocessing.Pool

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.

Co-Authored-By: Akinori Hattori <hattya@gmail.com>
11 months agogh-104745: Limit starting a patcher more than once without stopping it (#126649)
Red4Ru [Wed, 13 Nov 2024 08:20:38 +0000 (11:20 +0300)] 
gh-104745: Limit starting a patcher more than once without stopping it (#126649)

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

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months agobpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (#30196)
Andrew Svetlov [Wed, 13 Nov 2024 04:24:33 +0000 (05:24 +0100)] 
bpo-46128: Strip IsolatedAsyncioTestCase frames from reported stacktraces (#30196)

* Strip IsolatedAsyncioTestCase frames from reported stacktraces

* Update Misc/NEWS.d/next/Library/2021-12-19-10-47-24.bpo-46128.Qv3EK1.rst

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.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 agogh-126757: fix minor typo (GH-126758)
Yuxuan Zhang [Tue, 12 Nov 2024 21:23:40 +0000 (16:23 -0500)] 
gh-126757: fix minor typo (GH-126758)

11 months agogh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)
Nice Zombies [Tue, 12 Nov 2024 21:18:03 +0000 (22:18 +0100)] 
gh-119826: Improved fallback for ntpath.abspath() on Windows (GH-119938)

11 months agogh-126688: Reinit import lock after fork (#126692)
Sam Gross [Tue, 12 Nov 2024 20:53:58 +0000 (20:53 +0000)] 
gh-126688: Reinit import lock after fork (#126692)

The PyMutex implementation supports unlocking after fork because we
clear the list of waiters in parking_lot.c. This doesn't work as well
for _PyRecursiveMutex because on some systems, such as SerenityOS, the
thread id is not preserved across fork().

11 months agoGH-120423: `pathname2url()`: handle forward slashes in Windows paths (#126593)
Barney Gale [Tue, 12 Nov 2024 19:52:30 +0000 (19:52 +0000)] 
GH-120423: `pathname2url()`: handle forward slashes in Windows paths (#126593)

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

11 months agogh-116897: Deprecate generic false values in urllib.parse.parse_qsl() (GH-116903)
Serhiy Storchaka [Tue, 12 Nov 2024 19:10:29 +0000 (21:10 +0200)] 
gh-116897: Deprecate generic false values in urllib.parse.parse_qsl() (GH-116903)

Accepting objects with false values (like 0 and []) except empty strings
and byte-like objects and None in urllib.parse functions parse_qsl() and
parse_qs() is now deprecated.

11 months agogh-89083: add support for UUID version 8 (RFC 9562) (#123224)
Bénédikt Tran [Tue, 12 Nov 2024 18:08:49 +0000 (19:08 +0100)] 
gh-89083: add support for UUID version 8 (RFC 9562) (#123224)

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
11 months agogh-126705: Make os.PathLike more like a protocol (#126706)
Stephen Morton [Tue, 12 Nov 2024 17:54:13 +0000 (09:54 -0800)] 
gh-126705: Make os.PathLike more like a protocol (#126706)

it can now be used as a base class in other protocols

11 months agogh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707)
Eric Snow [Tue, 12 Nov 2024 17:41:51 +0000 (10:41 -0700)] 
gh-76785: Improved Subinterpreters Compatibility with 3.12 (2/2) (gh-126707)

These changes makes it easier to backport the _interpreters, _interpqueues, and _interpchannels modules to Python 3.12.

This involves the following:

* add the _PyXI_GET_STATE() and _PyXI_GET_GLOBAL_STATE() macros
* add _PyXIData_lookup_context_t and _PyXIData_GetLookupContext()
* add _Py_xi_state_init() and _Py_xi_state_fini()

11 months agogh-95382: Use cache for indentations in the JSON encoder (GH-118636)
Serhiy Storchaka [Tue, 12 Nov 2024 17:19:15 +0000 (19:19 +0200)] 
gh-95382: Use cache for indentations in the JSON encoder (GH-118636)

11 months agogh-126133: Only use start year in PSF copyright, remove end years (#126236)
Hugo van Kemenade [Tue, 12 Nov 2024 13:59:19 +0000 (15:59 +0200)] 
gh-126133: Only use start year in PSF copyright, remove end years (#126236)

11 months agogh-126061: Add PyLong_IsPositive/Zero/Negative() functions (#126065)
RUANG (James Roy) [Tue, 12 Nov 2024 13:18:06 +0000 (21:18 +0800)] 
gh-126061: Add PyLong_IsPositive/Zero/Negative() functions (#126065)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
11 months agogh-125916: Allow functools.reduce() 'initial' to be a keyword argument (#125917)
Sayandip Dutta [Tue, 12 Nov 2024 13:11:58 +0000 (18:41 +0530)] 
gh-125916: Allow functools.reduce() 'initial' to be a keyword argument (#125917)

11 months agogh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (#126617)
Bénédikt Tran [Tue, 12 Nov 2024 13:10:10 +0000 (14:10 +0100)] 
gh-126595: fix a crash when calling `itertools.count(sys.maxsize)` (#126617)

11 months agogh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` (#126733)
Kumar Aditya [Tue, 12 Nov 2024 12:31:34 +0000 (18:01 +0530)] 
gh-126405: fix use-after-free in `_asyncio.Future.remove_done_callback` (#126733)

11 months agogh-126209: Fix inconsistency of `skip_file_prefixes` in `warnings.warn`'s C and...
Daehee Kim [Tue, 12 Nov 2024 12:01:56 +0000 (21:01 +0900)] 
gh-126209: Fix inconsistency of  `skip_file_prefixes` in `warnings.warn`'s C and Python implementations (GH-126329)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
11 months agogh-126525: Fix `makeunicodedata.py` output on macOS and Windows (#126526)
sobolevn [Tue, 12 Nov 2024 10:23:57 +0000 (13:23 +0300)] 
gh-126525: Fix `makeunicodedata.py` output on macOS and Windows (#126526)