Commit graph

123516 commits

Author SHA1 Message Date
Miss Islington (bot)
c711deb803
[3.13] gh-127217: Fix pathname2url() for paths starting with multiple slashes on Posix (GH-127218) (GH-127230)
(cherry picked from commit 97b2ceaaaf)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-30 09:11:24 +00:00
Miss Islington (bot)
4cba0e66c2
[3.13] gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304) (#127390)
gh-127303: Add docs for token.EXACT_TOKEN_TYPES (GH-127304)

---------

(cherry picked from commit dd3a87d2a8)

Co-authored-by: Илья Любавский <100635212+lubaskinc0de@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-11-30 08:13:13 +00:00
Miss Islington (bot)
2f56c68dec
[3.13] gh-127316: fix incorrect assertion in setting __class__ in free-threading (GH-127399) (#127422)
gh-127316: fix incorrect assertion in setting `__class__` in free-threading (GH-127399)
(cherry picked from commit 45c5cba318)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-11-29 16:36:44 +00:00
Miss Islington (bot)
ee57221872
[3.13] Link to correct class methods in asyncio primitives docs (GH-127270) (#127423)
Link to correct class methods in asyncio primitives docs (GH-127270)
(cherry picked from commit 15d6506d17)

Co-authored-by: Ollanta Cuba Gyllensten <ollantaster@gmail.com>
2024-11-29 16:26:42 +00:00
Miss Islington (bot)
c4a359dc42
[3.13] gh-127208: Reject null character in _imp.create_dynamic() (GH-127400) (#127418)
gh-127208: Reject null character in _imp.create_dynamic() (GH-127400)

_imp.create_dynamic() now rejects embedded null characters in the
path and in the module name.
(cherry picked from commit b14fdadc6c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-29 15:45:21 +00:00
Miss Islington (bot)
6a0663404b
[3.13] gh-124873: Skip timerfd tests on Android (GH-127279) (#127290)
gh-124873: Skip timerfd tests on Android (GH-127279)

* Revert "[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (GH-127105)"

This reverts commit c09366b1fe.

* Skip timerfd tests on Android.

(cherry picked from commit 4ca2c82862)

Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-29 11:46:47 +00:00
Miss Islington (bot)
1056f38b3a
[3.13] gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358) (#127401)
gh-127258: Fix asyncio test_staggered_race_with_eager_tasks() (GH-127358)

Replace the sleep(2) with a task which is blocked forever.
(cherry picked from commit bfabf96b50)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-29 11:01:59 +00:00
Miss Islington (bot)
92d14b7fab
[3.13] fix param type in PyObject_HasAttrWithError (docs) (GH-127403) (#127404)
fix param type in PyObject_HasAttrWithError (docs) (GH-127403)
(cherry picked from commit 3afb639f39)

Co-authored-by: biggus-developerus <74741815+biggus-developerus@users.noreply.github.com>
2024-11-29 10:59:13 +00:00
Miss Islington (bot)
47b0f8f297
[3.13] gh-126881: fix finalization of dtoa state (GH-126904) (#127395)
gh-126881: fix finalization of dtoa state (GH-126904)
(cherry picked from commit 762c603a86)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-11-29 10:52:21 +00:00
Hugo van Kemenade
9bdb0ae5dc
[3.13] gh-127359: Pin Tcl/Tk to 8 (8.6) for testing macOS (#127365) (#127393) 2024-11-29 09:59:57 +00:00
Miss Islington (bot)
d5a08f0ecb
[3.13] Fix indentation for contextlib.asynccontextmanager docs (GH-127333) (#127334)
Fix indentation for contextlib.asynccontextmanager docs (GH-127333)
(cherry picked from commit 9328db7652)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-11-27 14:45:07 +00:00
Victor Stinner
a5741d63bc
[3.13] gh-122273: Support PyREPL history on Windows (#127141) (#127289)
gh-122273: Support PyREPL history on Windows (#127141)

Co-authored-by: devdanzin <74280297+devdanzin@users.noreply.github.com>
(cherry picked from commit 3c7a90a831)
2024-11-26 11:17:13 +00:00
Victor Stinner
9187ac3f2d
[3.13] gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055) (#127104)
* gh-126316: Make grp.getgrall() thread-safe: add a mutex (#127055)

grpmodule.c is no longer built with the limited C API, since PyMutex
is excluded from the limited C API.

(cherry picked from commit 3c2bd66e21)

* Revert ABI changes

Don't use Argument Clinic for grp.getgrgid() to avoid changing the
ABI (change PyInterpreterState structure by adding an "id"
identifier).
2024-11-26 12:01:50 +01:00
Miss Islington (bot)
0f77357905
[3.13] gh-127183: Add _ctypes.CopyComPointer tests (GH-127184) (GH-127251)
gh-127183: Add `_ctypes.CopyComPointer` tests (GH-127184)

* Make `create_shelllink_persist` top level function.

* Add `CopyComPointerTests`.

* Add more tests.

* Update tests.

* Add assertions for `Release`'s return value.
(cherry picked from commit c7f1e3e150)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
2024-11-26 11:13:08 +01:00
Miss Islington (bot)
8b2e30390c
[3.13] gh-101100: Fix sphinx warnings in howto/* (GH-127084) (#127287)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
2024-11-26 08:27:25 +00:00
Miss Islington (bot)
7f263d4444
[3.13] gh-127265: Remove single quotes from 'arrow's in tutorial/errors.rst (GH-127269)
(cherry picked from commit 26ff32b305)

Co-authored-by: funkyrailroad <funkyrailroad@users.noreply.github.com>
2024-11-25 21:39:59 +00:00
Miss Islington (bot)
a1b9663c41
[3.13] gh-127182: Fix io.StringIO.__setstate__ crash when None is the first value (GH-127219) (#127262)
gh-127182: Fix `io.StringIO.__setstate__` crash when `None` is the first value (GH-127219)
(cherry picked from commit a2ee899682)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-25 17:56:42 +00:00
Miss Islington (bot)
f0c47ea22e
[3.13] gh-126384: Add tests to verify the behavior of basic COM methods. (GH-126610) (GH-127159)
(cherry picked from commit 7725c0371a)

Co-authored-by: Jun Komoda <45822440+junkmd@users.noreply.github.com>
2024-11-25 13:18:27 +01:00
Yuki Kobayashi
56933198cc
[3.13] gh-101100: Fix sphinx warnings of removed opcodes (GH-127222) (#127239) 2024-11-25 10:50:48 +02:00
Miss Islington (bot)
a6e61fd9d8
[3.13] Improve pathname2url() and url2pathname() docs (GH-127125) (#127232)
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 307c633586)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-24 17:46:54 +00:00
Miss Islington (bot)
cb270e96af
[3.13] Fix macro expansions in critical section docs (GH-127226) (#127229)
(cherry picked from commit 2bb7846cac)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2024-11-24 17:26:40 +00:00
Miss Islington (bot)
24b86308f9
[3.13] gh-109413: Enable mypy's disallow_any_generics setting when checking libregrtest (GH-127033) (#127034)
gh-109413: Enable mypy's `disallow_any_generics` setting when checking `libregrtest` (GH-127033)
(cherry picked from commit 824afbf548)

Co-authored-by: sobolevn <mail@sobolevn.me>
2024-11-24 08:40:14 +00:00
Miss Islington (bot)
69472a5760
[3.13] gh-126991: Add tests for unpickling bad object state (GH-127031) (GH-127063)
This catches a memory leak in loading the BUILD opcode.
(cherry picked from commit addb225f38)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-24 03:16:54 +00:00
Miss Islington (bot)
a8e69fc68d
[3.13] gh-126896: Fix docs about asyncio.start_server() (GH-126897) (GH-126934)
gh-126896: Fix docs about `asyncio.start_server()` (GH-126897)
(cherry picked from commit 0c5c80928c)

Co-authored-by: beavailable <beavailable@proton.me>
2024-11-23 18:55:58 -08:00
Miss Islington (bot)
9dbce9f382
[3.13] Fix "useable" typo in docs (GH-127200) (#127207)
Fix "useable" typo in docs (GH-127200)

Fix typo in docs
(cherry picked from commit dbd23790db)

Co-authored-by: Stan U <89152624+StanFromIreland@users.noreply.github.com>
2024-11-23 17:50:06 -05:00
Miss Islington (bot)
b1a241ef4c
[3.13] Doc: C API: Fix Py_NewInterpreterFromConfig example code (GH-126667) (#127201)
Doc: C API: Fix `Py_NewInterpreterFromConfig` example code (GH-126667)
(cherry picked from commit e3038e976b)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-23 19:54:12 +00:00
Łukasz Langa
d87fb9c30d
[3.13] Enable aarch64 Ubuntu CI jobs (GH-125786) (GH-127170)
This change enables custom GHA runners for Ubuntu-24.04 that run on Arm hardware. It also prepares for Windows runners on Arm hardware, but doesn't enable that just yet, because the Arm GHA runner images for Windows need to be updated.
(cherry picked from commit 8214e0f709)
2024-11-23 10:40:25 +01:00
Miss Islington (bot)
9291095a74
[3.13] Fix a few typos found in the docs (GH-127126) (GH-127181)
Fix a few typos found in the docs (GH-127126)
(cherry picked from commit 39e60aeb38)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-11-23 00:09:35 +00:00
Serhiy Storchaka
75ef92da29
[3.13] gh-109746: Make _thread.start_new_thread delete state of new thread on its startup failure (GH-109761) (GH-127171)
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 ca3ea9ad05)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2024-11-22 19:55:44 +00:00
Damien
950daf8765
[3.13] gh-122544: Change OS image in GitHub Actions to Ubuntu 24.04 (#122566) (#126619)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-11-22 20:18:57 +01:00
Miss Islington (bot)
329865b883
[3.13] gh-88110: Clear concurrent.futures.thread._threads_queues after fork to avoid joining parent process' threads (GH-126098) (GH-127163)
Threads are gone after fork, so clear the queues too. Otherwise the
child process (here created via multiprocessing.Process) crashes on
interpreter exit.

(cherry picked from commit 1848ce61f3)

Co-authored-by: Andrei Bodrov <Drino@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-22 17:08:18 +00:00
Miss Islington (bot)
f0d1a20b77
[3.13] gh-109413: Fix libregrtest get_running() (GH-127153) (#127157)
gh-109413: Fix libregrtest get_running() (GH-127153)

Skip threads which are not running.
(cherry picked from commit 0cb20177d6)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-22 16:34:07 +00:00
Miss Islington (bot)
7f22b87d35
[3.13] gh-127001: Fix PATHEXT issues in shutil.which() on Windows (GH-127035) (GH-127156)
* 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 8899e85de1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-22 16:18:44 +00:00
Miss Islington (bot)
5468d219df
[3.13] gh-127065: Make methodcaller thread-safe in free threading build (GH-127109) (GH-127150)
The `methodcaller` C vectorcall implementation uses an arguments array
that is shared across calls. The first argument is modified on every
invocation. This isn't thread-safe in the free threading build. I think
it's also not safe in general, but for now just disable it in the free
threading build.
(cherry picked from commit f83ca6962a)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-11-22 14:51:40 +00:00
Miss Islington (bot)
1b58c0f308
[3.13] GH-122679: Add register() to argparse docs (GH-126939) (GH-127149)
(cherry picked from commit fcfdb55465)

Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
2024-11-22 16:12:05 +02:00
Jun Komoda
af00c58652
[3.13] gh-127082: Replace "Windows only" with the availability: Windows in ctypes doc (GH-127099) (#127144)
(cherry picked from commit 3c770e3f09)
2024-11-22 14:09:53 +01:00
Miss Islington (bot)
7bbcd32e59
[3.13] GH-127078: url2pathname(): handle extra slash before UNC drive in URL path (GH-127132) (#127135)
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 8c98ed846a)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-22 04:37:30 +00:00
Miss Islington (bot)
4b9068eeea
[3.13] GH-126766: url2pathname(): handle 'localhost' authority (GH-127129) (#127130)
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 ebf564a1d3)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-22 03:42:26 +00:00
Eric Snow
8cdd636f87
[3.13] gh-126986: Stop Using _PyInterpreterState_FailIfNotRunning() (gh-127112)
This is a pseudo-backport of d6b3e78 (gh-126988).  In that change for 3.14+, we dropped _PyInterpreterState_FailIfNotRunning() and added _PyErr_SetInterpreterAlreadyRunning().  Here, we replace usage of _PyInterpreterState_FailIfNotRunning() with the inlined equivalent of _PyErr_SetInterpreterAlreadyRunning(), without adding that function.  That way we avoid changing the 3.13 ABI.
2024-11-21 10:33:15 -07:00
Miss Islington (bot)
c74331413e
[3.13] gh-127020: Make PyCode_GetCode thread-safe for free threading (GH-127043) (GH-127107)
Some fields in PyCodeObject are lazily initialized. Use atomics and
critical sections to make their initializations and accesses thread-safe.
(cherry picked from commit 3926842117)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-11-21 16:27:36 +00:00
Miss Islington (bot)
c09366b1fe
[3.13] gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101) (#127105)
gh-124873: Tolerate 100 ms in TimerfdTests on Android (GH-127101)

On Android, TimerfdTests of test_os now uses 100 ms accuracy instead
of 10 ms.
(cherry picked from commit bab4b0462e)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-21 15:29:01 +00:00
Miss Islington (bot)
48eb5c978e
gh-126780: Fix ntpath.normpath() for drive-relative paths (GH-126801)
(cherry picked from commit 60ec854bc2)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-11-21 15:10:12 +00:00
Serhiy Storchaka
6e5e7bc5f8
[3.13] gh-126727: Fix locale.nl_langinfo(locale.ERA) (GH-126730) (GH-127097)
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 4803cd0244)
2024-11-21 11:49:19 +00:00
Miss Islington (bot)
eaafc7857f
[3.13] gh-126997: Fix support of non-ASCII strings in pickletools (GH-127062) (GH-127094)
* 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 eaf2171082)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-11-21 11:40:52 +00:00
Miss Islington (bot)
746a0c5bc8
[3.13] GH-85168: Use filesystem encoding when converting to/from file URIs (GH-126852) (#127039)
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 c9b399fbdb)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-11-20 20:10:29 +00:00
Miss Islington (bot)
40b9b506fb
[3.13] Run apt update before apt install git in autoconf CI job (GH-127070)
(cherry picked from commit 0af4ec30bd)

Co-authored-by: Zachary Ware <zach@python.org>
2024-11-20 19:44:17 +00:00
Miss Islington (bot)
fd9c2a3727
[3.13] Doc: C API: PyThreadState::on_delete was removed in v3.13 (GH-126536) (#127053)
Doc: C API: `PyThreadState::on_delete` was removed in v3.13 (GH-126536)
(cherry picked from commit 9bca3ef575)

Co-authored-by: Richard Hansen <rhansen@rhansen.org>
2024-11-20 08:51:19 +00:00
Miss Islington (bot)
bb98a0afd8
[3.13] gh-126991: Fix reference leak in loading pickle's opcode BUILD (GH-126990) (GH-127018)
If PyObject_SetItem() fails in the `load_build()` function of _pickle.c, no DECREF for the `dict` variable.
(cherry picked from commit 29cbcbd73b)

Co-authored-by: Justin Applegate <70449145+Legoclones@users.noreply.github.com>
2024-11-19 20:19:39 +02:00
sobolevn
3fae84fe58
[3.13] gh-126980: Fix bytearray.__buffer__ crash on PyBUF_{READ,WRITE} (GH-126981) (#127023)
(cherry picked from commit 3932e1db53)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-11-19 20:37:53 +03:00
Miss Islington (bot)
dd222a4d47
[3.13] Update docs 'make serve' to suggest 'make htmllive' (GH-126969) (#127015)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-11-19 17:41:33 +02:00