]> git.ipfire.org Git - thirdparty/Python/cpython.git/log
thirdparty/Python/cpython.git
20 months agogh-111225: Link extension modules against libpython on Android (#115780)
Malcolm Smith [Wed, 21 Feb 2024 23:18:57 +0000 (23:18 +0000)] 
gh-111225: Link extension modules against libpython on Android (#115780)

Part of the work on PEP 738: Adding Android as a supported platform.

* Rename the LIBPYTHON variable to MODULE_LDFLAGS, to more accurately
  reflect its purpose.
* Edit makesetup to use MODULE_LDFLAGS when linking extension modules.
* Edit the Makefile so that extension modules depend on libpython on
  Android and Cygwin.
* Restore `-fPIC` on Android. It was removed several years ago with a
  note that the toolchain used it automatically, but this is no longer
  the case. Omitting it causes all linker commands to fail with an error
  like `relocation R_AARCH64_ADR_PREL_PG_HI21 cannot be used against
  symbol '_Py_FalseStruct'; recompile with -fPIC`.

20 months agogh-93205: When rotating logs with no namer specified, match whole extension (GH-93224)
Gabriele Catania [Wed, 21 Feb 2024 21:09:06 +0000 (21:09 +0000)] 
gh-93205: When rotating logs with no namer specified, match whole extension (GH-93224)

20 months agogh-115491: Keep some fields valid across allocations in obmalloc (free-threading...
Sam Gross [Wed, 21 Feb 2024 18:00:08 +0000 (13:00 -0500)] 
gh-115491: Keep some fields valid across allocations in obmalloc (free-threading) (#115745)

20 months agogh-115304: Add doc for initializing PyMutex as a global variable (#115305)
AN Long [Wed, 21 Feb 2024 17:35:53 +0000 (01:35 +0800)] 
gh-115304: Add doc for initializing PyMutex as a global variable (#115305)

20 months agogh-96310: Fix a traceback in argparse when all options in a mutually exclusive group...
Daniel Mach [Wed, 21 Feb 2024 13:58:04 +0000 (14:58 +0100)] 
gh-96310: Fix a traceback in argparse when all options in a mutually exclusive group are suppressed (GH-96311)

Reproducer depends on terminal size - the traceback occurs when there's
an option long enough so the usage line doesn't fit the terminal width.
Option order is also important for reproducibility.

Excluding empty groups (with all options suppressed) from inserts
fixes the problem.

20 months agogh-104090: Add exit code to multiprocessing ResourceTracker (GH-115410)
Petr Viktorin [Wed, 21 Feb 2024 12:54:57 +0000 (13:54 +0100)] 
gh-104090: Add exit code to multiprocessing ResourceTracker (GH-115410)

This builds on https://github.com/python/cpython/pull/106807, which adds
a return code to ResourceTracker, to make future debugging easier.
Testing this “in situ” proved difficult, since the global ResourceTracker is
involved in test infrastructure. So, the tests here create a new instance and
feed it fake data.

---------

Co-authored-by: Yonatan Bitton <yonatan.bitton@perception-point.io>
Co-authored-by: Yonatan Bitton <bityob@gmail.com>
Co-authored-by: Antoine Pitrou <antoine@python.org>
20 months agoargparse: remove incoherent and redundant docstring for private method (GH-101591)
Frank Dana [Wed, 21 Feb 2024 11:32:28 +0000 (06:32 -0500)] 
argparse: remove incoherent and redundant docstring for private method (GH-101591)

Signed-off-by: FeRD (Frank Dana) <ferdnyc@gmail.com>
20 months agogh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400)
Sebastian Pipping [Wed, 21 Feb 2024 11:26:16 +0000 (12:26 +0100)] 
gh-115399: Document CVE-2023-52425 under "XML vulnerabilities" (GH-115400)

Doc/library/xml.rst: Document CVE-2023-52425 under "XML vulnerabilities"

20 months agogh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753)
Victor Stinner [Wed, 21 Feb 2024 10:46:00 +0000 (11:46 +0100)] 
gh-110850: Cleanup PyTime API: PyTime_t are nanoseconds (#115753)

PyTime_t no longer uses an arbitrary unit, it's always a number of
nanoseconds (64-bit signed integer).

* Rename _PyTime_FromNanosecondsObject() to _PyTime_FromLong().
* Rename _PyTime_AsNanosecondsObject() to _PyTime_AsLong().
* Remove pytime_from_nanoseconds().
* Remove pytime_as_nanoseconds().
* Remove _PyTime_FromNanoseconds().

20 months agogh-112364: Correct unparsing of backslashes and quotes in ast.unparse (#115696)
Frank Hoffmann [Wed, 21 Feb 2024 10:24:08 +0000 (11:24 +0100)] 
gh-112364: Correct unparsing of backslashes and quotes in ast.unparse (#115696)

20 months agogh-115737: Correct libpython install name for macOS shared library builds. (gh-115750)
Russell Keith-Magee [Wed, 21 Feb 2024 09:11:04 +0000 (17:11 +0800)] 
gh-115737: Correct libpython install name for macOS shared library builds. (gh-115750)

20 months agogh-115653: Document PyCode_GetFirstFree() (#115654)
Bogdan Romanyuk [Wed, 21 Feb 2024 09:01:36 +0000 (12:01 +0300)] 
gh-115653: Document PyCode_GetFirstFree() (#115654)

Correct the return type of the PyCode_GetNumFree() documentation.

20 months agogh-110850: Replace private _PyTime_MAX with public PyTime_MAX (#115751)
Victor Stinner [Wed, 21 Feb 2024 08:11:40 +0000 (09:11 +0100)] 
gh-110850: Replace private _PyTime_MAX with public PyTime_MAX (#115751)

Remove references to the old names _PyTime_MIN
and _PyTime_MAX, now that PyTime_MIN and
PyTime_MAX are public.

Replace also _PyTime_MIN with PyTime_MIN.

20 months agoDelete unused sym_clear_flag function. (#115744)
Benjamin Peterson [Wed, 21 Feb 2024 01:40:48 +0000 (17:40 -0800)] 
Delete unused sym_clear_flag function. (#115744)

20 months agogh-112087: Make list_{concat, repeat, inplace_repeat, ass_item) to be thread-safe...
Donghee Na [Wed, 21 Feb 2024 01:38:09 +0000 (10:38 +0900)] 
gh-112087: Make list_{concat, repeat, inplace_repeat, ass_item)  to be thread-safe (gh-115605)

20 months agogh-112075: Accessing a single element should optimistically avoid locking (#115109)
Dino Viehland [Wed, 21 Feb 2024 01:08:14 +0000 (17:08 -0800)] 
gh-112075: Accessing a single element should optimistically avoid locking (#115109)

Makes accessing a single element thread safe and typically lock free

20 months agogh-112075: Make PyDictKeysObject thread-safe (#114741)
Dino Viehland [Wed, 21 Feb 2024 00:40:37 +0000 (16:40 -0800)] 
gh-112075: Make PyDictKeysObject thread-safe (#114741)

Adds locking for shared PyDictKeysObject's for dictionaries

20 months agogh-110850: Use public PyTime functions (#115746)
Victor Stinner [Tue, 20 Feb 2024 23:31:30 +0000 (00:31 +0100)] 
gh-110850: Use public PyTime functions (#115746)

Replace private _PyTime functions with public PyTime functions.

random_seed_time_pid() now reports errors to its caller.

20 months agogh-110850: Rename internal PyTime C API functions (#115734)
Victor Stinner [Tue, 20 Feb 2024 22:16:37 +0000 (23:16 +0100)] 
gh-110850: Rename internal PyTime C API functions (#115734)

Rename functions:

* _PyTime_GetSystemClock() => _PyTime_TimeUnchecked()
* _PyTime_GetPerfCounter() => _PyTime_PerfCounterUnchecked()
* _PyTime_GetMonotonicClock() => _PyTime_MonotonicUnchecked()
* _PyTime_GetSystemClockWithInfo() => _PyTime_TimeWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()
* _PyTime_GetMonotonicClockWithInfo() => _PyTime_MonotonicWithInfo()

Changes:

* Remove "typedef PyTime_t PyTime_t;" which was
  "typedef PyTime_t _PyTime_t;" before a previous rename.
* Update comments of "Unchecked" functions.
* Remove invalid PyTime_Time() comment.

20 months agogh-104061: Add socket.SO_BINDTOIFINDEX constant (GH-104062)
Victor Westerhuis [Tue, 20 Feb 2024 21:08:15 +0000 (22:08 +0100)] 
gh-104061: Add socket.SO_BINDTOIFINDEX constant (GH-104062)

Add socket.SO_BINDTOIFINDEX constant

This socket option avoids a race condition between SO_BINDTODEVICE and network interface renaming.

20 months agoTier 2 cleanups and tweaks (#115534)
Guido van Rossum [Tue, 20 Feb 2024 20:24:35 +0000 (12:24 -0800)] 
Tier 2 cleanups and tweaks (#115534)

* Rename `_testinternalcapi.get_{uop,counter}_optimizer` to `new_*_optimizer`
* Use `_PyUOpName()` instead of` _PyOpcode_uop_name[]`
* Add `target` to executor iterator items -- `list(ex)` now returns `(opcode, oparg, target, operand)` quadruples
* Add executor methods `get_opcode()` and `get_oparg()` to get `vmdata.opcode`, `vmdata.oparg`
* Define a helper for printing uops, and unify various places where they are printed
* Add a hack to summarize_stats.py to fix legacy uop names (e.g. `POP_TOP` -> `_POP_TOP`)
* Define helpers in `test_opt.py` for accessing the set or list of opnames of an executor

20 months agogh-115733: Fix crash involving exhausted list iterator (#115740)
Sam Gross [Tue, 20 Feb 2024 20:18:44 +0000 (15:18 -0500)] 
gh-115733: Fix crash involving exhausted list iterator (#115740)

* gh-115733: Fix crash involving exhausted iterator

* Add blurb

20 months agoGH-115727: Temporary fix of confidence score test. (GH-115728)
Mark Shannon [Tue, 20 Feb 2024 18:50:31 +0000 (18:50 +0000)] 
GH-115727: Temporary fix of confidence score test. (GH-115728)

Temporary fix of confidence score test.

20 months agogh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)
Ken Jin [Tue, 20 Feb 2024 18:47:05 +0000 (02:47 +0800)] 
gh-115735: Fix current executor NULL before _START_EXECUTOR (#115736)

This fixes level 3 or higher lltrace debug output `--with-pydebug` runs.

20 months agogh-115103: Implement delayed free mechanism for free-threaded builds (#115367)
Sam Gross [Tue, 20 Feb 2024 18:04:37 +0000 (13:04 -0500)] 
gh-115103: Implement delayed free mechanism for free-threaded builds (#115367)

This adds `_PyMem_FreeDelayed()` and supporting functions. The
`_PyMem_FreeDelayed()` function frees memory with the same allocator as
`PyMem_Free()`, but after some delay to ensure that concurrent lock-free
readers have finished.

20 months agogh-110850: Cleanup pycore_time.h includes (#115724)
Victor Stinner [Tue, 20 Feb 2024 16:50:43 +0000 (17:50 +0100)] 
gh-110850: Cleanup pycore_time.h includes (#115724)

<pycore_time.h> include is no longer needed to get the PyTime_t type
in internal header files. This type is now provided by <Python.h>
include. Add <pycore_time.h> includes to C files instead.

20 months agogh-86291: linecache: get module name from __spec__ if available (GH-22908)
Eugene Toder [Tue, 20 Feb 2024 16:47:41 +0000 (11:47 -0500)] 
gh-86291: linecache: get module name from __spec__ if available (GH-22908)

This allows getting source code for the __main__ module when a custom
loader is used.

20 months agogh-115712: Support CSV dialects with delimiter=' ' and skipinitialspace=True (GH...
Serhiy Storchaka [Tue, 20 Feb 2024 16:09:50 +0000 (18:09 +0200)] 
gh-115712: Support CSV dialects with delimiter=' ' and skipinitialspace=True (GH-115721)

Restore support of such combination, disabled in gh-113796.

csv.writer() now quotes empty fields if delimiter is a space and
skipinitialspace is true and raises exception if quoting is not possible.

20 months agogh-115491: Keep some fields valid across allocations (free-threading) (#115573)
Sam Gross [Tue, 20 Feb 2024 15:36:40 +0000 (10:36 -0500)] 
gh-115491: Keep some fields valid across allocations (free-threading) (#115573)

This avoids filling the memory occupied by ob_tid, ob_ref_local, and
ob_ref_shared with debug bytes (e.g., 0xDD) in mimalloc in the
free-threaded build.

20 months agogh-101860: Expose __name__ on property (GH-101876)
Eugene Toder [Tue, 20 Feb 2024 15:14:34 +0000 (10:14 -0500)] 
gh-101860: Expose __name__ on property (GH-101876)

Useful for introspection and consistent with functions and other
descriptors.

20 months agogh-110850: Replace _PyTime_t with PyTime_t (#115719)
Victor Stinner [Tue, 20 Feb 2024 15:02:27 +0000 (16:02 +0100)] 
gh-110850: Replace _PyTime_t with PyTime_t (#115719)

Run command:

sed -i -e 's!\<_PyTime_t\>!PyTime_t!g' $(find -name "*.c" -o -name "*.h")

20 months agogh-112175: Add `eval_breaker` to `PyThreadState` (#115194)
Brett Simmers [Tue, 20 Feb 2024 14:57:48 +0000 (06:57 -0800)] 
gh-112175: Add `eval_breaker` to `PyThreadState` (#115194)

This change adds an `eval_breaker` field to `PyThreadState`. The primary
motivation is for performance in free-threaded builds: with thread-local eval
breakers, we can stop a specific thread (e.g., for an async exception) without
interrupting other threads.

The source of truth for the global instrumentation version is stored in the
`instrumentation_version` field in PyInterpreterState. Threads usually read the
version from their local `eval_breaker`, where it continues to be colocated
with the eval breaker bits.

20 months agogh-112020: Document the meaning of empty bytes returned by socket.recv() (GH-112055)
talcs [Tue, 20 Feb 2024 14:54:33 +0000 (16:54 +0200)] 
gh-112020: Document the meaning of empty bytes returned by socket.recv() (GH-112055)

20 months agogh-110850: Enhance PyTime C API tests (#115715)
Victor Stinner [Tue, 20 Feb 2024 14:53:40 +0000 (15:53 +0100)] 
gh-110850: Enhance PyTime C API tests (#115715)

20 months agoAdd missed `stream` argument (#111775)
Alexander Shadchin [Tue, 20 Feb 2024 14:09:46 +0000 (17:09 +0300)] 
Add missed `stream` argument (#111775)

* Add missed `stream` argument

* Add news

20 months agogh-110850: PyTime_Time() return 0 on success (GH-115713)
Victor Stinner [Tue, 20 Feb 2024 13:35:41 +0000 (14:35 +0100)] 
gh-110850: PyTime_Time() return 0 on success (GH-115713)

Thanks!

20 months agogh-115687: Split up guards from COMPARE_OP (GH-115688)
Ken Jin [Tue, 20 Feb 2024 11:30:49 +0000 (19:30 +0800)] 
gh-115687: Split up guards from COMPARE_OP (GH-115688)

20 months agogh-115700: Add target `_RegenCases` in Windows build for cases regeneration. (GH...
Kirill Podoprigora [Tue, 20 Feb 2024 11:10:47 +0000 (14:10 +0300)] 
gh-115700: Add target `_RegenCases` in Windows build for cases regeneration. (GH-115708)

20 months agoGH-115457: Support splitting and replication of micro ops. (GH-115558)
Mark Shannon [Tue, 20 Feb 2024 10:50:59 +0000 (10:50 +0000)] 
GH-115457: Support splitting and replication of micro ops.  (GH-115558)

20 months agoGH-112354: Initial implementation of warm up on exits and trace-stitching (GH-114142)
Mark Shannon [Tue, 20 Feb 2024 09:39:55 +0000 (09:39 +0000)] 
GH-112354: Initial implementation of warm up on exits and trace-stitching (GH-114142)

20 months agogh-113157: Document and test __get__ for MethodType (gh-115492)
Raymond Hettinger [Tue, 20 Feb 2024 07:53:25 +0000 (01:53 -0600)] 
gh-113157: Document and test __get__ for MethodType (gh-115492)

20 months agoMake the title match the content (GH-115702)
Raymond Hettinger [Tue, 20 Feb 2024 07:51:56 +0000 (01:51 -0600)] 
Make the title match the content (GH-115702)

20 months agoModernize the Sorting HowTo guide (gh-115479)
Raymond Hettinger [Tue, 20 Feb 2024 03:22:07 +0000 (21:22 -0600)] 
Modernize the Sorting HowTo guide (gh-115479)

20 months agogh-115539: Allow enum.Flag to have None members (GH-115636)
Jason Zhang [Mon, 19 Feb 2024 22:36:11 +0000 (22:36 +0000)] 
gh-115539: Allow enum.Flag to have None members (GH-115636)

20 months agogh-115543: Update py.exe to know about Python 3.13 and to install 3.12 by default...
Steve Dower [Mon, 19 Feb 2024 20:36:20 +0000 (20:36 +0000)] 
gh-115543: Update py.exe to know about Python 3.13 and to install 3.12 by default (GH-115544)

20 months agoFix typo in multiprocessing docs (#115650)
Naglis Jonaitis [Mon, 19 Feb 2024 18:19:14 +0000 (20:19 +0200)] 
Fix typo in multiprocessing docs (#115650)

20 months agogh-115664: Fix versionadded and versionchanged directives in multiprocessing.rst...
Serhiy Storchaka [Mon, 19 Feb 2024 18:03:42 +0000 (20:03 +0200)] 
gh-115664: Fix versionadded and versionchanged directives in multiprocessing.rst (GH-115665)

20 months agogh-115664: Fix chronological ordering of versionadded and versionchanged directives...
Brian Schubert [Mon, 19 Feb 2024 17:54:54 +0000 (12:54 -0500)] 
gh-115664: Fix chronological ordering of versionadded and versionchanged directives (#115676)

20 months agogh-60346: Improve handling single-dash options in ArgumentParser.parse_known_args...
Serhiy Storchaka [Mon, 19 Feb 2024 17:20:00 +0000 (19:20 +0200)] 
gh-60346: Improve handling single-dash options in ArgumentParser.parse_known_args() (GH-114180)

20 months agogh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342)
Serhiy Storchaka [Mon, 19 Feb 2024 17:03:21 +0000 (19:03 +0200)] 
gh-115341: Fix loading unit tests with doctests in -OO mode (GH-115342)

20 months agoFix test_py_compile with -O mode (GH-115345)
Serhiy Storchaka [Mon, 19 Feb 2024 17:02:51 +0000 (19:02 +0200)] 
Fix test_py_compile with -O mode (GH-115345)

20 months agoFix test_compile with -O mode (GH-115346)
Serhiy Storchaka [Mon, 19 Feb 2024 17:02:29 +0000 (19:02 +0200)] 
Fix test_compile with -O mode (GH-115346)

20 months agogh-115154: Fix untokenize handling of unicode named literals (#115171)
Pablo Galindo Salgado [Mon, 19 Feb 2024 14:54:10 +0000 (14:54 +0000)] 
gh-115154: Fix untokenize handling of unicode named literals (#115171)

20 months agogh-115652: Fix indentation in the documentation of multiprocessing.get_start_method...
Daniel Haag [Mon, 19 Feb 2024 14:26:23 +0000 (15:26 +0100)] 
gh-115652: Fix indentation in the documentation of multiprocessing.get_start_method (GH-115658)

20 months agogh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561)
Victor Stinner [Mon, 19 Feb 2024 12:20:46 +0000 (13:20 +0100)] 
gh-114626: Add again _PyCFunctionFastWithKeywords name (GH-115561)

Keep the old private _PyCFunctionFastWithKeywords name (Python 3.7)
as an alias to the new public name PyCFunctionFastWithKeywords
(Python 3.13a4).

_PyCFunctionWithKeywords doesn't exist in Python 3.13a3, whereas
_PyCFunctionFastWithKeywords was removed in Python 3.13a4.

20 months agogh-83648: Add missing `deprecated` arg in argparse.rst (GH-115640)
0xflotus [Mon, 19 Feb 2024 08:29:32 +0000 (09:29 +0100)] 
gh-83648: Add missing `deprecated` arg in argparse.rst (GH-115640)

20 months agogh-102388: Add windows_31j to aliases for cp932 codec (#102389)
Masayuki Moriyama [Mon, 19 Feb 2024 08:01:35 +0000 (17:01 +0900)] 
gh-102388: Add windows_31j to aliases for cp932 codec (#102389)

The charset name "Windows-31J" is registered in the IANA Charset Registry[1]
and is implemented in Python as the cp932 codec.

[1] https://www.iana.org/assignments/charset-reg/windows-31J

Signed-off-by: Masayuki Moriyama <masayuki.moriyama@miraclelinux.com>
20 months agoDocs: Add explanation about little/big endian (#109841)
Simon A. Eugster [Mon, 19 Feb 2024 07:50:09 +0000 (08:50 +0100)] 
Docs: Add explanation about little/big endian (#109841)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
20 months agogh-111358: Fix timeout behaviour in BaseEventLoop.shutdown_default_executor (#115622)
Jamie Phan [Mon, 19 Feb 2024 00:01:00 +0000 (11:01 +1100)] 
gh-111358: Fix timeout behaviour in BaseEventLoop.shutdown_default_executor (#115622)

20 months agogh-114709: Mark commonpath behaviour as changed in 3.13 (#115639)
Shantanu [Sun, 18 Feb 2024 22:08:50 +0000 (14:08 -0800)] 
gh-114709: Mark commonpath behaviour as changed in 3.13 (#115639)

20 months agogh-115122: Add --bisect option to regrtest (#115123)
Victor Stinner [Sun, 18 Feb 2024 20:06:39 +0000 (21:06 +0100)] 
gh-115122: Add --bisect option to regrtest (#115123)

* test.bisect_cmd now exit with code 0 on success, and code 1 on
  failure. Before, it was the opposite.
* test.bisect_cmd now runs the test worker process with
  -X faulthandler.
* regrtest RunTests: Add create_python_cmd() and bisect_cmd()
  methods.

20 months agogh-115572: Move `codeobject.replace()` docs to the data model (#115631)
Daler [Sun, 18 Feb 2024 14:13:46 +0000 (19:13 +0500)] 
gh-115572: Move `codeobject.replace()` docs to the data model (#115631)

20 months agogh-114709: Fix exceptions raised by posixpath.commonpath (#114710)
Sebastian Rittau [Sun, 18 Feb 2024 08:24:58 +0000 (09:24 +0100)] 
gh-114709: Fix exceptions raised by posixpath.commonpath (#114710)

Fix the exceptions raised by posixpath.commonpath

Raise ValueError, not IndexError when passed an empty iterable. Raise
TypeError, not ValueError when passed None.

20 months agogh-108303: Move `Lib/test/sortperf.py` to `Tools/scripts` (#114687)
Nikita Sobolev [Sun, 18 Feb 2024 07:27:14 +0000 (10:27 +0300)] 
gh-108303: Move `Lib/test/sortperf.py` to `Tools/scripts` (#114687)

20 months agogh-115618: Remove improper Py_XDECREFs in property methods (GH-115619)
Serhiy Storchaka [Sat, 17 Feb 2024 21:18:30 +0000 (23:18 +0200)] 
gh-115618: Remove improper Py_XDECREFs in property methods (GH-115619)

20 months agogh-100176: Remove outdated Tools/{io,cc,string}bench (#101853)
Hugo van Kemenade [Sat, 17 Feb 2024 21:17:21 +0000 (23:17 +0200)] 
gh-100176: Remove outdated Tools/{io,cc,string}bench (#101853)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
20 months agogh-115596: Fix ProgramPriorityTests in test_os permanently changing the process prior...
Brian Schubert [Sat, 17 Feb 2024 16:42:57 +0000 (11:42 -0500)] 
gh-115596: Fix ProgramPriorityTests in test_os permanently changing the process priority (GH-115610)

20 months agoFix ProgramPriorityTests on FreeBSD with high nice value (GH-100145)
Dmitry Marakasov [Sat, 17 Feb 2024 14:54:47 +0000 (17:54 +0300)] 
Fix ProgramPriorityTests on FreeBSD with high nice value (GH-100145)

It expects priority to be capped with 19, which is the cap for Linux,
but for FreeBSD the cap is 20 and the test fails under the similar
conditions. Tweak the condition to cover FreeBSD as well.

20 months agogh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout output...
Kirill Podoprigora [Sat, 17 Feb 2024 13:17:55 +0000 (16:17 +0300)] 
gh-115567: Catch test_ctypes.test_callbacks.test_i38748_stackCorruption stdout output (GH-115568)

20 months agoDocument use of ANY in test assertions (GH-94060)
Thomas Grainger [Sat, 17 Feb 2024 13:13:34 +0000 (13:13 +0000)] 
Document use of ANY in test assertions (GH-94060)

20 months agogh-107155: Fix help() for lambda function with return annotation (GH-107401)
Kirill Podoprigora [Sat, 17 Feb 2024 12:47:51 +0000 (15:47 +0300)] 
gh-107155: Fix help() for lambda function with return annotation (GH-107401)

20 months agogh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope...
wookie184 [Sat, 17 Feb 2024 12:06:31 +0000 (12:06 +0000)] 
gh-96497: Mangle name before symtable lookup in 'symtable_extend_namedexpr_scope' (GH-96561)

20 months agogh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825)
Matthew Hughes [Sat, 17 Feb 2024 11:57:51 +0000 (11:57 +0000)] 
gh-97590: Update docs and tests for ftplib.FTP.voidcmd() (GH-96825)

Since 2f3941d743481ac48628b8b2c075f2b82762050b this function returns the
response string, rather than nothing.

20 months agogh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH...
6t8k [Sat, 17 Feb 2024 11:16:06 +0000 (11:16 +0000)] 
gh-95782: Fix io.BufferedReader.tell() etc. being able to return offsets < 0 (GH-99709)

lseek() always returns 0 for character pseudo-devices like
`/dev/urandom` (for other non-regular files, e.g. `/dev/stdin`, it
always returns -1, to which CPython reacts by raising appropriate
exceptions). They are thus technically seekable despite not having seek
semantics.

When calling read() on e.g. an instance of `io.BufferedReader` that
wraps such a file, `BufferedReader` reads ahead, filling its buffer,
creating a discrepancy between the number of bytes read and the internal
`tell()` always returning 0, which previously resulted in e.g.
`BufferedReader.tell()` or `BufferedReader.seek()` being able to return
positions < 0 even though these are supposed to be always >= 0.

Invariably keep the return value non-negative by returning
max(former_return_value, 0) instead, and add some corresponding tests.

20 months agogh-56499: Update the pickle library's note section for the __setstate__ function...
Furkan Onder [Sat, 17 Feb 2024 10:51:43 +0000 (13:51 +0300)] 
gh-56499: Update the pickle library's note section for the __setstate__ function (GH-101062)

20 months agogh-87688: Amend SSLContext.hostname_checks_common_name docs (GH-100517)
Rami [Sat, 17 Feb 2024 10:22:19 +0000 (12:22 +0200)] 
gh-87688: Amend SSLContext.hostname_checks_common_name docs (GH-100517)

20 months agogh-100884: email/_header_value_parser: don't encode list separators (GH-100885)
Thomas Weißschuh [Sat, 17 Feb 2024 10:13:46 +0000 (11:13 +0100)] 
gh-100884: email/_header_value_parser: don't encode list separators (GH-100885)

ListSeparator should not be encoded. This could happen when a long line
pushes its separator to the next line, which would have been encoded.

20 months agogh-100985: Consistently wrap IPv6 IP address during CONNECT (GH-100986)
Derek Higgins [Sat, 17 Feb 2024 10:10:12 +0000 (10:10 +0000)] 
gh-100985: Consistently wrap IPv6 IP address during CONNECT (GH-100986)

Update _get_hostport to always remove square brackets
from IPv6 addresses. Then add them if needed
in "CONNECT .." and "Host: ".

20 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (#115580)
Hugo van Kemenade [Sat, 17 Feb 2024 10:03:20 +0000 (12:03 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.2.rst` (#115580)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
20 months agogh-101100: Fix Sphinx warnings in `whatsnew/3.1.rst` (#115575)
Hugo van Kemenade [Sat, 17 Feb 2024 09:39:07 +0000 (11:39 +0200)] 
gh-101100: Fix Sphinx warnings in `whatsnew/3.1.rst` (#115575)

20 months agogh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL...
Peter Jiping Xie [Sat, 17 Feb 2024 09:12:12 +0000 (20:12 +1100)] 
gh-101384: Add socket timeout to ThreadedVSOCKSocketStreamTest and skip it on WSL (GH-101419)

20 months agogh-101699: Explain using Match.expand with \g<0> (GH-101701)
Stevoisiak [Sat, 17 Feb 2024 08:33:28 +0000 (03:33 -0500)] 
gh-101699: Explain using Match.expand with \g<0> (GH-101701)

Update documentation for re library to explain that a backreference `\g<0>` is
expanded to the entire string when using Match.expand().
Note that numeric backreferences to group 0 (`\0`) are not supported.

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
20 months agogh-113812: Allow DatagramTransport.sendto to send empty data (#115199)
Jamie Phan [Sat, 17 Feb 2024 02:38:07 +0000 (13:38 +1100)] 
gh-113812: Allow DatagramTransport.sendto to send empty data (#115199)

Also include the UDP packet header sizes (8 bytes per packet)
in the buffer size reported to the flow control subsystem.

20 months agogh-111968: Split _Py_async_gen_asend_freelist out of _Py_async_gen_fr… (gh-115546)
Donghee Na [Sat, 17 Feb 2024 01:03:10 +0000 (10:03 +0900)] 
gh-111968: Split _Py_async_gen_asend_freelist out of _Py_async_gen_fr… (gh-115546)

20 months agodocs: Add glossary term references to shutil docs (#115559)
Brian Schubert [Fri, 16 Feb 2024 22:04:17 +0000 (17:04 -0500)] 
docs: Add glossary term references to shutil docs (#115559)

Add glossary term references to shutil docs

20 months agogh-85294: Handle missing arguments to @singledispatchmethod gracefully (GH-21471)
Ammar Askar [Fri, 16 Feb 2024 21:17:30 +0000 (16:17 -0500)] 
gh-85294: Handle missing arguments to @singledispatchmethod gracefully (GH-21471)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
20 months agogh-115103: Implement delayed memory reclamation (QSBR) (#115180)
Sam Gross [Fri, 16 Feb 2024 20:25:19 +0000 (15:25 -0500)] 
gh-115103: Implement delayed memory reclamation (QSBR) (#115180)

This adds a safe memory reclamation scheme based on FreeBSD's "GUS" and
quiescent state based reclamation (QSBR). The API provides a mechanism
for callers to detect when it is safe to free memory that may be
concurrently accessed by readers.

20 months agogh-115556: Remove quotes from command-line arguments in test.bat and rt.bat (#115557)
Łukasz Langa [Fri, 16 Feb 2024 20:24:56 +0000 (21:24 +0100)] 
gh-115556: Remove quotes from command-line arguments in test.bat and rt.bat (#115557)

This change essentially replaces usage of `%1` with `%~1`, which removes
quotes, if any. Without this change, the if statements fail due to
the quotes mangling the syntax.

Additionally, this change works around comma being treated as a parameter
delimiter in test.bat by escaping commas at time of parsing. Tested
combinations of rt and regrtest arguments, all seems to work as before
but now you can specify commas in arguments like "-uall,extralargefile".

20 months agogh-112720: make it easier to subclass and modify dis.ArgResolver's jump arg resolutio...
Irit Katriel [Fri, 16 Feb 2024 19:25:19 +0000 (19:25 +0000)] 
gh-112720: make it easier to subclass and modify dis.ArgResolver's jump arg resolution (#115564)

20 months agogh-114271: Make `thread._rlock` thread-safe in free-threaded builds (#115102)
mpage [Fri, 16 Feb 2024 18:29:25 +0000 (10:29 -0800)] 
gh-114271: Make `thread._rlock` thread-safe in free-threaded builds (#115102)

The ID of the owning thread (`rlock_owner`) may be accessed by
multiple threads without holding the underlying lock; relaxed
atomics are used in place of the previous loads/stores.

The number of times that the lock has been acquired (`rlock_count`)
is only ever accessed by the thread that holds the lock; we do not
need to use atomics to access it.

20 months agogh-115480: Type / constant propagation for float binary uops (GH-115550)
Peter Lazorchak [Fri, 16 Feb 2024 18:02:48 +0000 (10:02 -0800)] 
gh-115480: Type / constant propagation for float binary uops (GH-115550)

Co-authored-by: Ken Jin <kenjin@python.org>
20 months agogh-115362: Add documentation to pystats output (#115365)
Michael Droettboom [Fri, 16 Feb 2024 17:06:07 +0000 (12:06 -0500)] 
gh-115362: Add documentation to pystats output (#115365)

20 months agogh-113743: Give _PyTypes_AfterFork a prototype. (gh-115563)
Benjamin Peterson [Fri, 16 Feb 2024 16:49:41 +0000 (08:49 -0800)] 
gh-113743: Give _PyTypes_AfterFork a prototype. (gh-115563)

Fixes a compiler warning.

20 months agogh-112529: Make the GC scheduling thread-safe (#114880)
Sam Gross [Fri, 16 Feb 2024 16:22:27 +0000 (11:22 -0500)] 
gh-112529: Make the GC scheduling thread-safe (#114880)

The GC keeps track of the number of allocations (less deallocations)
since the last GC. This buffers the count in thread-local state and uses
atomic operations to modify the per-interpreter count. The thread-local
buffering avoids contention on shared state.

A consequence is that the GC scheduling is not as precise, so
"test_sneaky_frame_object" is skipped because it requires that the GC be
run exactly after allocating a frame object.

20 months agogh-115480: Minor fixups in int constant propagation (GH-115507)
Ken Jin [Fri, 16 Feb 2024 14:59:43 +0000 (22:59 +0800)] 
gh-115480: Minor fixups in int constant propagation (GH-115507)

20 months agogh-102013: Move PyUnstable_GC_VisitObjects() to Include/cpython/objimpl.h (#115560)
Victor Stinner [Fri, 16 Feb 2024 14:49:13 +0000 (15:49 +0100)] 
gh-102013: Move PyUnstable_GC_VisitObjects() to Include/cpython/objimpl.h (#115560)

Include/objimpl.h must only contain the limited C API, whereas
PyUnstable_GC_VisitObjects() is excluded from the limited C API.

20 months agoAdd `Python/tier2_redundancy_eliminator_cases.c.h` to `.gitattributes` as generated...
Nikita Sobolev [Fri, 16 Feb 2024 13:10:21 +0000 (16:10 +0300)] 
Add `Python/tier2_redundancy_eliminator_cases.c.h` to `.gitattributes` as generated (#115551)

20 months agogh-69990: Make Profile.print_stats support sorting by multiple values (GH-104590)
Furkan Onder [Fri, 16 Feb 2024 12:03:46 +0000 (15:03 +0300)] 
gh-69990: Make Profile.print_stats support sorting by multiple values (GH-104590)

Co-authored-by: Chiu-Hsiang Hsu
20 months agogh-113317: Argument Clinic: move C/Py identifier helpers into libclinic (#115520)
Erlend E. Aasland [Fri, 16 Feb 2024 06:42:15 +0000 (07:42 +0100)] 
gh-113317: Argument Clinic: move C/Py identifier helpers into libclinic (#115520)

20 months agogh-115503: Fix `run_presite` error handling (#115504)
Nikita Sobolev [Fri, 16 Feb 2024 05:33:17 +0000 (08:33 +0300)] 
gh-115503: Fix `run_presite` error handling (#115504)