]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
10 months agogh-128116: Skip test_socket VSOCK testStream() on PermissionError (#128120)
Victor Stinner [Fri, 20 Dec 2024 12:38:00 +0000 (13:38 +0100)] 
gh-128116: Skip test_socket VSOCK testStream() on PermissionError (#128120)

10 months agogh-109959: Log the current directory in test_glob.test_selflink() (#128122)
Victor Stinner [Fri, 20 Dec 2024 12:37:20 +0000 (13:37 +0100)] 
gh-109959: Log the current directory in test_glob.test_selflink() (#128122)

10 months agoGH-122548: Correct magic number comment (GH-128115)
Mark Shannon [Fri, 20 Dec 2024 11:57:44 +0000 (11:57 +0000)] 
GH-122548: Correct magic number comment (GH-128115)

Correct magic number comment

10 months agogh-128030: Avoid error from PyModule_GetFilenameObject for non-module (#128047)
Shantanu [Fri, 20 Dec 2024 08:22:26 +0000 (00:22 -0800)] 
gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (#128047)

I missed the extra `PyModule_Check` in #127660 because I was looking at
3.12 as the base implementation for import from. This meant that I
missed the `PyModuleCheck` introduced in #112661.

10 months agogh-128058: Fix test_builtin ImmortalTests (#128068)
Victor Stinner [Fri, 20 Dec 2024 07:50:18 +0000 (08:50 +0100)] 
gh-128058: Fix test_builtin ImmortalTests (#128068)

On 32-bit Free Threading systems, immortal reference count
is 5 << 28, instead of 7 << 28.

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
10 months agogh-112328: Document EnumDict in docs and release notes (GH-121720)
Md Rokibul Islam [Thu, 19 Dec 2024 23:38:42 +0000 (00:38 +0100)] 
gh-112328: Document EnumDict in docs and release notes (GH-121720)

Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
10 months agogh-128080: remove unnecessary `__init__` method from Enum (GH-128081)
Stephen Morton [Thu, 19 Dec 2024 22:07:17 +0000 (14:07 -0800)] 
gh-128080: remove unnecessary `__init__` method from Enum (GH-128081)

remove unnecessary __init__ method from Enum

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
10 months agogh-127274: Defer nested methods (#128012)
mpage [Thu, 19 Dec 2024 21:03:14 +0000 (13:03 -0800)] 
gh-127274: Defer nested methods (#128012)

Methods (functions defined in class scope) are likely to be cleaned
up by the GC anyway.

Add a new code flag, `CO_METHOD`, that is set for functions defined
in a class scope. Use that when deciding to defer functions.

10 months agogh-128062: Fix the font size and shortcut display of the turtledemo menu (#128063)
Zhikang Yan [Thu, 19 Dec 2024 20:24:47 +0000 (04:24 +0800)] 
gh-128062: Fix the font size and shortcut display of the turtledemo menu (#128063)

Leave the font of the menu bar the default to keep it consistent with the rest of the world. Display the shortcut keys in the right way, using the 'accelerator' option.
---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
10 months agogh-115999: Specialize `STORE_ATTR` in free-threaded builds. (gh-127838)
Neil Schemenauer [Thu, 19 Dec 2024 18:21:17 +0000 (10:21 -0800)] 
gh-115999: Specialize `STORE_ATTR` in free-threaded builds. (gh-127838)

* Add `_PyDictKeys_StringLookupSplit` which does locking on dict keys and
  use in place of `_PyDictKeys_StringLookup`.

* Change `_PyObject_TryGetInstanceAttribute` to use that function
  in the case of split keys.

* Add `unicodekeys_lookup_split` helper which allows code sharing
  between `_Py_dict_lookup` and `_PyDictKeys_StringLookupSplit`.

* Fix locking for `STORE_ATTR_INSTANCE_VALUE`.  Create
  `_GUARD_TYPE_VERSION_AND_LOCK` uop so that object stays locked and
  `tp_version_tag` cannot change.

* Pass `tp_version_tag` to `specialize_dict_access()`, ensuring
  the version we store on the cache is the correct one (in case of
  it changing during the specalize analysis).

* Split `analyze_descriptor` into `analyze_descriptor_load` and
  `analyze_descriptor_store` since those don't share much logic.
  Add `descriptor_is_class` helper function.

* In `specialize_dict_access`, double check `_PyObject_GetManagedDict()`
  in case we race and dict was materialized before the lock.

* Avoid borrowed references in `_Py_Specialize_StoreAttr()`.

* Use `specialize()` and `unspecialize()` helpers.

* Add unit tests to ensure specializing happens as expected in FT builds.

* Add unit tests to attempt to trigger data races (useful for running under TSAN).

* Add `has_split_table` function to `_testinternalcapi`.

10 months agoGH-122548: Implement branch taken and not taken events for sys.monitoring (GH-122564)
Mark Shannon [Thu, 19 Dec 2024 16:59:51 +0000 (16:59 +0000)] 
GH-122548: Implement branch taken and not taken events for sys.monitoring (GH-122564)

10 months agogh-128008: Add `PyWeakref_IsDead()` (GH-128009)
Sam Gross [Thu, 19 Dec 2024 15:17:15 +0000 (10:17 -0500)] 
gh-128008: Add `PyWeakref_IsDead()` (GH-128009)

The `PyWeakref_IsDead()` function tests if a weak reference is dead
without any side effects. Although you can also detect if a weak
reference is dead using `PyWeakref_GetRef()`, that function returns a
strong reference that must be `Py_DECREF()`'d, which can introduce side
effects if the last reference is concurrently dropped (at least in the
free threading build).

10 months agogh-127951: Add build option to enable pystats on Windows (GH-127952)
Pieter Eendebak [Thu, 19 Dec 2024 14:45:34 +0000 (15:45 +0100)] 
gh-127951: Add build option to enable pystats on Windows (GH-127952)

10 months agogh-128083: Fix macro redefinition warning in clinic. (GH-127950)
Peter Bierma [Thu, 19 Dec 2024 14:00:30 +0000 (09:00 -0500)] 
gh-128083: Fix macro redefinition warning in clinic. (GH-127950)

10 months agogh-127688: Add `SCHED_DEADLINE` and `SCHED_NORMAL` constants to `os` module (GH-127689)
RUANG (James Roy) [Thu, 19 Dec 2024 13:51:21 +0000 (21:51 +0800)] 
gh-127688: Add `SCHED_DEADLINE` and `SCHED_NORMAL` constants to `os` module (GH-127689)

10 months agogh-122706: fix docs for asyncio ssl sockets (#128092)
Kumar Aditya [Thu, 19 Dec 2024 12:45:36 +0000 (18:15 +0530)] 
gh-122706: fix docs for asyncio ssl sockets (#128092)

10 months agogh-128013: fix data race in `PyUnicode_AsUTF8AndSize` on free-threading (#128021)
Kumar Aditya [Thu, 19 Dec 2024 11:38:32 +0000 (17:08 +0530)] 
gh-128013: fix data race in `PyUnicode_AsUTF8AndSize` on free-threading (#128021)

10 months agogh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's...
Victor Stinner [Thu, 19 Dec 2024 10:27:29 +0000 (11:27 +0100)] 
gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (#128090)

brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
10 months agogh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build (gh-127737)
Donghee Na [Thu, 19 Dec 2024 02:08:17 +0000 (11:08 +0900)] 
gh-115999: Enable BINARY_SUBSCR_GETITEM for free-threaded build (gh-127737)

10 months agogh-128013: Convert unicodeobject.c macros to functions (#128061)
Victor Stinner [Wed, 18 Dec 2024 15:34:31 +0000 (16:34 +0100)] 
gh-128013: Convert unicodeobject.c macros to functions (#128061)

Convert unicodeobject.c macros to static inline functions.

* Add _PyUnicode_SET_UTF8() and _PyUnicode_SET_UTF8_LENGTH() macros.
* Add PyUnicode_HASH() and PyUnicode_SET_HASH() macros.
* Remove unused _PyUnicode_KIND() and _PyUnicode_GET_LENGTH() macros.

10 months agogh-128033: change `PyMutex_LockFast` to take `PyMutex` as argument (#128054)
Kumar Aditya [Wed, 18 Dec 2024 15:19:00 +0000 (20:49 +0530)] 
gh-128033: change `PyMutex_LockFast` to take `PyMutex` as argument (#128054)

Change `PyMutex_LockFast` to take `PyMutex` as argument.

10 months agogh-121621: clear running loop early in asyncio (#128004)
Kumar Aditya [Wed, 18 Dec 2024 14:25:03 +0000 (19:55 +0530)] 
gh-121621: clear running loop early in asyncio (#128004)

10 months agogh-127949: deprecate `asyncio.get_event_loop_policy` (#128053)
Kumar Aditya [Wed, 18 Dec 2024 12:34:20 +0000 (18:04 +0530)] 
gh-127949: deprecate `asyncio.get_event_loop_policy` (#128053)

This deprecates `asyncio.get_event_loop_policy` and will be removed in Python 3.16.

10 months agogh-126639: Add ResourceWarning to NamedTemporaryFile (#126677)
Thomas Grainger [Wed, 18 Dec 2024 10:12:24 +0000 (10:12 +0000)] 
gh-126639: Add ResourceWarning to NamedTemporaryFile (#126677)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-126742: add NEWS entry for fix of localized error messages (GH-128025)
Bénédikt Tran [Wed, 18 Dec 2024 08:59:37 +0000 (09:59 +0100)] 
gh-126742: add NEWS entry for fix of localized error messages (GH-128025)

10 months agogh-126742: Avoid checking for library filename in test_ctypes (#128034)
Bénédikt Tran [Wed, 18 Dec 2024 08:25:42 +0000 (09:25 +0100)] 
gh-126742: Avoid checking for library filename in test_ctypes (#128034)

Avoid checking for library filename in `dlerror()` error messages of test_ctypes.

10 months agogh-127174: add docs for asyncio.get_event_loop replacements (#127640)
Thomas Grainger [Wed, 18 Dec 2024 08:20:05 +0000 (08:20 +0000)] 
gh-127174: add docs for asyncio.get_event_loop replacements (#127640)

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-127897: fix HACL* build on macOS/Catalina (GH-127932)
aeiouaeiouaeiouaeiouaeiouaeiou [Wed, 18 Dec 2024 06:14:16 +0000 (09:14 +0300)] 
gh-127897: fix HACL* build on macOS/Catalina (GH-127932)

gh-127897: Update HACL* module from upstream sources to get:

- Lib_Memzero0.c: don't use memset_s() on macOS <10.9
- Use _mm_malloc() for KRML_ALIGNED_MALLOC on macOS <10.15
- Add LEGACY_MACOS macros, use _mm_free() for KRML_ALIGNED_FREE on macOS <10.15

10 months agogh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)
Kumar Aditya [Wed, 18 Dec 2024 06:05:29 +0000 (11:35 +0530)] 
gh-127949: deprecate `asyncio.set_event_loop_policy` (#128024)

First step towards deprecating the asyncio policy system.
This deprecates `asyncio.set_event_loop_policy` and will be removed in Python 3.16.

10 months agogh-127060: Disable traceback colors in IDLE (#128028)
Victor Stinner [Wed, 18 Dec 2024 05:35:05 +0000 (06:35 +0100)] 
gh-127060: Disable traceback colors in IDLE (#128028)

Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.

10 months agogh-127146: Emscripten Include compiler version in _PYTHON_HOST_PLATFORM (#127992)
Hood Chatham [Tue, 17 Dec 2024 23:17:09 +0000 (00:17 +0100)] 
gh-127146: Emscripten Include compiler version in _PYTHON_HOST_PLATFORM (#127992)

Modifies _PYTHON_HOST_PLATFORM to include the compiler version under
Emscripten. The Emscripten compiler version is the platform version
compatibility identifier.

10 months agoMerge branch 'main' of https://github.com/python/cpython
Hugo van Kemenade [Tue, 17 Dec 2024 16:06:36 +0000 (18:06 +0200)] 
Merge branch 'main' of https://github.com/python/cpython

10 months agoPost 3.14.0a3
Hugo van Kemenade [Tue, 17 Dec 2024 15:52:43 +0000 (17:52 +0200)] 
Post 3.14.0a3

10 months agogh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746)
Bénédikt Tran [Tue, 17 Dec 2024 11:12:45 +0000 (12:12 +0100)] 
gh-126742: Add _PyErr_SetLocaleString, use it for gdbm & dlerror messages (GH-126746)

- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages

Co-authored-by: Victor Stinner <vstinner@python.org>
10 months agoPython 3.14.0a3 v3.14.0a3
Hugo van Kemenade [Tue, 17 Dec 2024 09:49:37 +0000 (11:49 +0200)] 
Python 3.14.0a3

10 months agogh-127085: Add a test skip if multiprocessing isn't available (#128019)
Russell Keith-Magee [Tue, 17 Dec 2024 08:18:33 +0000 (16:18 +0800)] 
gh-127085: Add a test skip if multiprocessing isn't available (#128019)

Add a test skip if multiprocessing isn't available.

10 months agogh-127146: Emscripten clean up test suite (#127984)
Hood Chatham [Tue, 17 Dec 2024 07:48:23 +0000 (08:48 +0100)] 
gh-127146: Emscripten clean up test suite (#127984)

Removed test skips that are no longer required as a result of Emscripten updates.

10 months agoFree arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910)
Berker Peksag [Mon, 16 Dec 2024 20:59:36 +0000 (22:59 +0200)] 
Free arena on _PyCompile_AstOptimize failure in Py_CompileStringObject (GH-127910)

After commit 10a91d7e9 introduced arena cleanup, commit 2dfbd4f36
removed the free call when _PyCompile_AstOptimize fails.

10 months agogh-126907: make `atexit` thread safe in free-threading (#127935)
Peter Bierma [Mon, 16 Dec 2024 19:31:44 +0000 (14:31 -0500)] 
gh-126907: make `atexit` thread safe in free-threading (#127935)

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
10 months agogh-127085: fix some data races in memoryview in free-threading (#127412)
Edward Xu [Mon, 16 Dec 2024 19:12:19 +0000 (03:12 +0800)] 
gh-127085: fix some data races in memoryview in free-threading (#127412)

10 months agoRevert "gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587...
Hugo van Kemenade [Mon, 16 Dec 2024 18:18:02 +0000 (20:18 +0200)] 
Revert "gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)" (#127983)

This reverts commit 46006a1b355f75d06c10e7b8086912c483b34487.

10 months agoFix typo in itertools docs (gh-127995)
Gugubo [Mon, 16 Dec 2024 17:08:25 +0000 (18:08 +0100)] 
Fix typo in itertools docs (gh-127995)

10 months agogh-127864: Fix compiler warning (-Wstringop-truncation) (GH-127878)
Tomas R. [Mon, 16 Dec 2024 16:57:18 +0000 (17:57 +0100)] 
gh-127864: Fix compiler warning (-Wstringop-truncation) (GH-127878)

10 months agogh-127896: Add missing documentation of `PySequence_In` (GH-127979)
Yuki Kobayashi [Mon, 16 Dec 2024 13:56:04 +0000 (22:56 +0900)] 
gh-127896: Add missing documentation of `PySequence_In` (GH-127979)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
10 months agogh-111178: fix UBSan failures in `_elementtree.c` (#127982)
Bénédikt Tran [Mon, 16 Dec 2024 13:40:26 +0000 (14:40 +0100)] 
gh-111178: fix UBSan failures in `_elementtree.c` (#127982)

10 months agogh-125588: Allow to regenerate the parser with Python < 3.12 (#127969)
Pablo Galindo Salgado [Sun, 15 Dec 2024 23:17:01 +0000 (23:17 +0000)] 
gh-125588: Allow to regenerate the parser with Python < 3.12 (#127969)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
10 months agoGH-126985: Don't override venv detection with PYTHONHOME (#127968)
Filipe Laíns 🇵🇸 [Sun, 15 Dec 2024 21:12:13 +0000 (21:12 +0000)] 
GH-126985: Don't override venv detection with PYTHONHOME (#127968)

10 months agogh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)
Stephen Hansen [Sun, 15 Dec 2024 19:53:22 +0000 (14:53 -0500)] 
gh-127586: properly restore blocked signals in resource_tracker.py (GH-127587)

* Correct pthread_sigmask in resource_tracker to restore old signals

Using SIG_UNBLOCK to remove blocked "ignored signals" may accidentally
cause side effects if the calling parent already had said signals
blocked to begin with and did not intend to unblock them when
creating a pool. Use SIG_SETMASK instead with the previous mask of
blocked signals to restore the original blocked set.

* Adding resource_tracker blocked signals test

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
10 months agogh-119786: Fix miscellaneous typos in `InternalDocs/interpreter_definition.md` (...
Stan Ulbrych [Sun, 15 Dec 2024 17:11:50 +0000 (17:11 +0000)] 
gh-119786: Fix miscellaneous typos in `InternalDocs/interpreter_definition.md` (#127957)

10 months agogetpath: Add comments highlighing details of the pyvenv.cfg detection (#127966)
Filipe Laíns 🇵🇸 [Sun, 15 Dec 2024 15:40:19 +0000 (15:40 +0000)] 
getpath: Add comments highlighing details of the pyvenv.cfg detection (#127966)

10 months agogh-127599: Fix _Py_RefcntAdd missing calls to _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL...
Ed Nutting [Sun, 15 Dec 2024 13:51:03 +0000 (14:51 +0100)] 
gh-127599: Fix _Py_RefcntAdd missing calls to _Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC (#127717)

Previously, `_Py_RefcntAdd` hasn't called
`_Py_INCREF_STAT_INC/_Py_INCREF_IMMORTAL_STAT_INC` which is incorrect.

Now it has been fixed.

10 months agoClarify ast docs to use a less confusing example for `ast.ParamSpec` (#127955)
Steve C [Sun, 15 Dec 2024 12:28:43 +0000 (07:28 -0500)] 
Clarify ast docs to use a less confusing example for `ast.ParamSpec` (#127955)

Fix typo in ast docs: ParamSpec defaults

10 months agogh-127353: Allow to force color output on Windows V2 (#127926)
Andrey Efremov [Sat, 14 Dec 2024 15:25:49 +0000 (22:25 +0700)] 
gh-127353: Allow to force color output on Windows V2 (#127926)

10 months agogh-127852: add remark about ',' separator (#127854)
Sergey B Kirpichev [Sat, 14 Dec 2024 13:28:26 +0000 (16:28 +0300)] 
gh-127852: add remark about ',' separator (#127854)

Specify that it is valid for floats and ints with 'd' presentation and an error otherwise.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
---------

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
10 months agoFix typo in docstring: quadruple double quotes (#127913)
Totosuki [Sat, 14 Dec 2024 07:38:54 +0000 (16:38 +0900)] 
Fix typo in docstring: quadruple double quotes (#127913)

10 months agogh-127747: Resolve BytesWarning in test.support.strace_helper (#127849)
Cody Maloney [Sat, 14 Dec 2024 07:36:47 +0000 (23:36 -0800)] 
gh-127747: Resolve BytesWarning in test.support.strace_helper (#127849)

The strace_helper code has a _make_error function to simplify making
StraceResult objects in error cases. That takes a details parameter
which is either a caught OSError or `bytes`. If it's bytes, _make_error
would implicitly coerce that to a str inside of a f-string, resulting in
 a BytesWarning.

It's useful to see if it's an OSError or bytes when debugging, resolve
by changing to format with repr().

This is an error message on an internal helper.

A non-zero exit code occurs if the strace binary isn't found, and no
events will be parsed in that case (there is no output). Handle that
case by checking exit code before checking for events.

Still asserting around events rather than returning false, so that
hopefully if there's some change to `strace` that breaks the parsing,
will see that as a test failure rather than silently loosing strace
tests because they are auto-disabled.

10 months agogh-115999: Specialize loading attributes from modules in free-threaded builds (#127711)
mpage [Fri, 13 Dec 2024 18:17:16 +0000 (10:17 -0800)] 
gh-115999: Specialize loading attributes from modules in free-threaded builds (#127711)

We use the same approach that was used for specialization of LOAD_GLOBAL in free-threaded builds:

_CHECK_ATTR_MODULE is renamed to _CHECK_ATTR_MODULE_PUSH_KEYS; it pushes the keys object for the following _LOAD_ATTR_MODULE_FROM_KEYS (nee _LOAD_ATTR_MODULE). This arrangement avoids having to recheck the keys version.

_LOAD_ATTR_MODULE is renamed to _LOAD_ATTR_MODULE_FROM_KEYS; it loads the value from the keys object pushed by the preceding _CHECK_ATTR_MODULE_PUSH_KEYS at the cached index.

10 months agoMinor readability improvements for the itertools recipes (gh-127928)
Raymond Hettinger [Fri, 13 Dec 2024 18:12:49 +0000 (12:12 -0600)] 
Minor readability improvements for the itertools recipes (gh-127928)

10 months agogh-126024: unicodeobject: optimize find_first_nonascii (GH-127790)
Inada Naoki [Fri, 13 Dec 2024 16:21:46 +0000 (01:21 +0900)] 
gh-126024: unicodeobject: optimize find_first_nonascii (GH-127790)

Remove 1 branch.

10 months agogh-127691: add type checks when using `PyUnicodeError` objects (GH-127694)
Bénédikt Tran [Fri, 13 Dec 2024 16:16:22 +0000 (17:16 +0100)] 
gh-127691: add type checks when using `PyUnicodeError` objects (GH-127694)

10 months agogh-102471, PEP 757: Add PyLong import and export API (#121339)
Victor Stinner [Fri, 13 Dec 2024 13:24:48 +0000 (14:24 +0100)] 
gh-102471, PEP 757: Add PyLong import and export API (#121339)

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Steve Dower <steve.dower@microsoft.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
10 months agogh-127906: Test the limited C API in test_cppext (#127916)
Victor Stinner [Fri, 13 Dec 2024 13:23:20 +0000 (14:23 +0100)] 
gh-127906: Test the limited C API in test_cppext (#127916)

10 months agogh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872)
Victor Stinner [Fri, 13 Dec 2024 12:53:47 +0000 (13:53 +0100)] 
gh-127870: Detect recursive calls in ctypes _as_parameter_ handling (#127872)

10 months agoGH-126833: Dumps graphviz representation of executor graph. (GH-126880)
Mark Shannon [Fri, 13 Dec 2024 11:00:00 +0000 (11:00 +0000)] 
GH-126833: Dumps graphviz representation of executor graph. (GH-126880)

10 months agogh-126868: Add freelist for compact int objects (GH-126865)
Pieter Eendebak [Fri, 13 Dec 2024 10:06:26 +0000 (11:06 +0100)] 
gh-126868: Add freelist for compact int objects (GH-126865)

10 months agoGH-125174: Don't use `UINT32_MAX` in header file (GH-127863)
Mark Shannon [Fri, 13 Dec 2024 09:54:59 +0000 (09:54 +0000)] 
GH-125174: Don't use `UINT32_MAX` in header file (GH-127863)

10 months agolink to the correct output method in documentation (#127857)
Viktor Kálmán [Fri, 13 Dec 2024 09:27:02 +0000 (10:27 +0100)] 
link to the correct output method in documentation (#127857)

10 months agoDocument PyObject_SelfIter (#127861)
Miro Hrončok [Fri, 13 Dec 2024 09:26:22 +0000 (10:26 +0100)] 
Document PyObject_SelfIter (#127861)

10 months agogh-127845: Minor improvements to iOS test runner script (#127846)
Russell Keith-Magee [Thu, 12 Dec 2024 21:49:02 +0000 (05:49 +0800)] 
gh-127845: Minor improvements to iOS test runner script (#127846)

Uses symlinks to install iOS framework into testbed clone, adds a verbose mode
to the iOS runner to hide most Xcode output, adds another mechanism to disable
terminal colors, and ensures that stdout is flushed after every write.

10 months agoFix typo in traceback docs (#127884)
Daniel Haag [Thu, 12 Dec 2024 21:43:44 +0000 (22:43 +0100)] 
Fix typo in traceback docs (#127884)

10 months agoGH-127724: don't use sysconfig to calculate the venv local include path (#127731)
Filipe Laíns 🇵🇸 [Thu, 12 Dec 2024 21:41:46 +0000 (21:41 +0000)] 
GH-127724: don't use sysconfig to calculate the venv local include path (#127731)

10 months agoRevert "gh-127353: Allow to force color output on Windows (#127354)" (#127889)
Hugo van Kemenade [Thu, 12 Dec 2024 21:11:20 +0000 (23:11 +0200)] 
Revert "gh-127353: Allow to force color output on Windows (#127354)" (#127889)

This reverts commit 365451e28368db46ae89a3a990d85c10c2284aa2.

10 months agoFix typos in `Lib/_pydecimal.py` (#127700)
Stan Ulbrych [Thu, 12 Dec 2024 20:27:29 +0000 (20:27 +0000)] 
Fix typos in `Lib/_pydecimal.py` (#127700)

10 months agogh-127353: Allow to force color output on Windows (#127354)
Andrey Efremov [Thu, 12 Dec 2024 20:17:39 +0000 (03:17 +0700)] 
gh-127353: Allow to force color output on Windows (#127354)

10 months agogh-127865: Fix build failure for systems without thread local support (GH-127866)
velemas [Thu, 12 Dec 2024 18:07:55 +0000 (20:07 +0200)] 
gh-127865: Fix build failure for systems without thread local support (GH-127866)

This PR fixes the build issue introduced by the commit 628f6eb from
GH-112207 on systems without thread local support.

10 months agogh-127879: Fix data race in `_PyFreeList_Push` (#127880)
Sam Gross [Thu, 12 Dec 2024 17:59:13 +0000 (17:59 +0000)] 
gh-127879: Fix data race in `_PyFreeList_Push` (#127880)

Writes to the `ob_tid` field need to use atomics because it may be
concurrently read by a non-locking dictionary, list, or structmember
read.

10 months agoGH-127807: pathlib ABCs: remove `PathBase._unsupported_msg()` (#127855)
Barney Gale [Thu, 12 Dec 2024 17:39:24 +0000 (17:39 +0000)] 
GH-127807: pathlib ABCs: remove `PathBase._unsupported_msg()` (#127855)

This method helped us customise the `UnsupportedOperation` message
depending on the type. But we're aiming to make `PathBase` a proper ABC
soon, so `NotImplementedError` is the right exception to raise there.

10 months agoGH-125174: Fix compiler warning (GH-127860)
Mark Shannon [Thu, 12 Dec 2024 11:22:20 +0000 (11:22 +0000)] 
GH-125174: Fix compiler warning (GH-127860)

Fix compiler warning

10 months agoGH-127381: pathlib ABCs: remove remaining uncommon `PathBase` methods (#127714)
Barney Gale [Thu, 12 Dec 2024 06:49:34 +0000 (06:49 +0000)] 
GH-127381: pathlib ABCs: remove remaining uncommon `PathBase` methods (#127714)

Remove the following methods from `pathlib._abc.PathBase`:

- `expanduser()`
- `hardlink_to()`
- `touch()`
- `chmod()`
- `lchmod()`
- `owner()`
- `group()`
- `from_uri()`
- `as_uri()`

These operations aren't regularly supported in virtual filesystems, so they
don't win a place in the `PathBase` interface. (Some of them probably don't
deserve a place in `Path` :P.) They're quasi-abstract (except `lchmod()`),
and they're not called by other `PathBase` methods.

10 months agoSimplify and speed-up an itertools recipe (gh-127848)
Raymond Hettinger [Thu, 12 Dec 2024 03:24:56 +0000 (21:24 -0600)] 
Simplify and speed-up an itertools recipe (gh-127848)

10 months agogh-127740: Add some more tests for earlier PR #127756 (#127818)
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Thu, 12 Dec 2024 02:18:12 +0000 (07:48 +0530)] 
gh-127740: Add some more tests for earlier PR #127756 (#127818)

10 months agogh-127146: Some expected failures in Emscripten time tests (#127843)
Hood Chatham [Thu, 12 Dec 2024 01:11:00 +0000 (02:11 +0100)] 
gh-127146: Some expected failures in Emscripten time tests (#127843)

Disables two tests in the test_time suite, and adjusts test_os to reflect
precision limits in Emscripten.

10 months agogh-115999: Specialize `CALL_KW` in free-threaded builds (#127713)
mpage [Wed, 11 Dec 2024 23:18:22 +0000 (15:18 -0800)] 
gh-115999: Specialize `CALL_KW` in free-threaded builds (#127713)

* Enable specialization of CALL_KW

* Fix bug pushing frame in _PY_FRAME_KW

`_PY_FRAME_KW` pushes a pointer to the new frame onto the stack for
consumption by the next uop. When pushing the frame fails, we do not
want to push the result, `NULL`, to the stack because it is not
a valid stackref. This works in the default build because `PyStackRef_NULL`
 and `NULL` are the same value, so the `PyStackRef_XCLOSE()` in the error
handler ignores it. In the free-threaded build the values are not the same;
`PyStackRef_XCLOSE()` will attempt to decref a null pointer.

10 months agogh-111609: Test `end_offset` in SyntaxError subclass (#127830)
Nice Zombies [Wed, 11 Dec 2024 18:32:54 +0000 (19:32 +0100)] 
gh-111609: Test `end_offset` in SyntaxError subclass (#127830)

Test `end_offset` in SyntaxError subclass

10 months agoGH-125174: Mark objects as statically allocated. (#127797)
Mark Shannon [Wed, 11 Dec 2024 17:37:38 +0000 (17:37 +0000)] 
GH-125174: Mark objects as statically allocated. (#127797)

* Set a bit in the unused part of the refcount on 64 bit machines and the free-threaded build.

* Use the top of the refcount range on 32 bit machines

10 months agogh-118915: C API: Document frame locals proxies. (#127720)
Peter Bierma [Wed, 11 Dec 2024 16:28:44 +0000 (11:28 -0500)] 
gh-118915: C API: Document frame locals proxies. (#127720)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
10 months agogh-127065: Make methodcaller thread-safe and re-entrant (GH-127746)
Pieter Eendebak [Wed, 11 Dec 2024 15:06:07 +0000 (16:06 +0100)] 
gh-127065: Make methodcaller thread-safe and re-entrant (GH-127746)

The function `operator.methodcaller` was not thread-safe since the additional
of the vectorcall method in gh-89013. In the free threading build the issue
is easy to trigger, for the normal build harder.

This makes the `methodcaller` safe by:

* Replacing the lazy initialization with initialization in the constructor.
* Using a stack allocated space for the vectorcall arguments and falling back
  to `tp_call` for calls with more than 8 arguments.

10 months agoGH-127058: Make `PySequence_Tuple` safer and probably faster. (#127758)
Mark Shannon [Wed, 11 Dec 2024 14:02:59 +0000 (14:02 +0000)] 
GH-127058: Make `PySequence_Tuple` safer and probably faster. (#127758)

* Use a small buffer, then list when constructing a tuple from an arbitrary sequence.

10 months agogh-123401: Fix http.cookies module to support obsolete RFC 850 date format (#123405)
Nano [Wed, 11 Dec 2024 13:28:19 +0000 (21:28 +0800)] 
gh-123401: Fix http.cookies module to support obsolete RFC 850 date format (#123405)

Co-authored-by: Wulian <1055917385@qq.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
10 months agoCI: Use bash to properly expand variable (#127822)
Hugo van Kemenade [Wed, 11 Dec 2024 12:57:51 +0000 (14:57 +0200)] 
CI: Use bash to properly expand variable (#127822)

10 months agogh-126992: Change pickle code to base 10 for load_long and load_int (GH-127042)
Justin Applegate [Wed, 11 Dec 2024 12:37:59 +0000 (05:37 -0700)] 
gh-126992: Change pickle code to base 10 for load_long and load_int (GH-127042)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
10 months agogh-127791: Fix, document, and test `PyUnstable_AtExit` (#127793)
Peter Bierma [Wed, 11 Dec 2024 11:14:04 +0000 (06:14 -0500)] 
gh-127791: Fix, document, and test `PyUnstable_AtExit` (#127793)

10 months agoAdd `extern "C"` around `PyTraceMalloc_` functions. (#127772)
Peter Hawkins [Wed, 11 Dec 2024 09:27:07 +0000 (04:27 -0500)] 
Add `extern "C"` around `PyTraceMalloc_` functions. (#127772)

Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.

10 months agogh-127740: For odd-length input to bytes.fromhex(...) change the error message to...
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి) [Wed, 11 Dec 2024 07:35:17 +0000 (13:05 +0530)] 
gh-127740: For odd-length input to bytes.fromhex(...) change the error message to  ValueError: fromhex() arg must be of even length (#127756)

10 months agoGH-127381: pathlib ABCs: remove `PathBase.samefile()` and rarer `is_*()` (#127709)
Barney Gale [Wed, 11 Dec 2024 00:09:55 +0000 (00:09 +0000)] 
GH-127381: pathlib ABCs: remove `PathBase.samefile()` and rarer `is_*()` (#127709)

Remove `PathBase.samefile()`, which is fairly specific to the local FS, and
relies on `stat()`, which we're aiming to remove from `PathBase`.

Also remove `PathBase.is_mount()`, `is_junction()`, `is_block_device()`,
`is_char_device()`, `is_fifo()` and `is_socket()`. These rely on POSIX
file type numbers that we're aiming to remove from the `PathBase` API.

10 months agogh-126821: Add versionadded annotation to use_system_logger feature. (#127755)
Russell Keith-Magee [Tue, 10 Dec 2024 21:32:04 +0000 (05:32 +0800)] 
gh-126821: Add versionadded annotation to use_system_logger feature. (#127755)

Add versionadded annotation to use_system_logger feature.

10 months agoDocs: Fix indents in `xmlrpc.client.rst` (#127782)
Yuki Kobayashi [Tue, 10 Dec 2024 17:35:00 +0000 (02:35 +0900)] 
Docs: Fix indents in `xmlrpc.client.rst` (#127782)

10 months agogh-59705: Set OS thread name when Thread.name is changed (#127702)
Victor Stinner [Tue, 10 Dec 2024 16:33:11 +0000 (17:33 +0100)] 
gh-59705: Set OS thread name when Thread.name is changed (#127702)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
10 months agogh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568)
Bénédikt Tran [Tue, 10 Dec 2024 15:58:17 +0000 (16:58 +0100)] 
gh-127563: use `dk_log2_index_bytes=3` in empty dicts (GH-127568)

This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.

10 months agogh-126937: ctypes: fix TypeError when a field's size is >65535 bytes (GH-126938)
Melissa0x1f992 [Tue, 10 Dec 2024 12:13:11 +0000 (06:13 -0600)] 
gh-126937: ctypes: fix TypeError when a field's size is >65535 bytes (GH-126938)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Petr Viktorin <encukou@gmail.com>