Commit Graph

118261 Commits

Author SHA1 Message Date
Michael The f877b32b87
gh-105578: Add more usage examples to `typing.AnyStr` docs (#107045)
``typing.AnyStr`` has different semantics to ``str | bytes``, which often leads to user confusion
2023-07-31 16:23:08 +01:00
opavliuk f22bf8e3cf
gh-87799: Improve the textual representation of IPv4-mapped IPv6 addresses (#29345)
Represent IPv4-mapped IPv6 address as xxxd.d.d.d,
where the 'x's are the hexadecimal values
of the six high-order 16-bit pieces of the address,
and the 'd's are the decimal values
of the four low-order 8-bit pieces of the address
(standard IPv4 representation).

---------

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2023-07-31 14:33:26 +00:00
Tomas R 520efecfc3
gh-105751: Remove obsolete `object` base class in some ctypes tests (#107460) 2023-07-31 14:48:27 +02:00
Georg Brandl f57b9fd2b6
no-issue: Fix typo in import.c (gh-107498) 2023-07-31 12:07:17 +00:00
Erlend E. Aasland 2c5d206b33
gh-106368: Add test for Argument Clinic misbehaving custom converter_init() (#107496) 2023-07-31 11:50:03 +00:00
Furkan Onder a1c737b73d
gh-104280: Add test cases for DTrace probes (#107125) 2023-07-31 10:33:37 +02:00
Konstantin 08447b5deb
gh-46376: Return existing pointer when possible in ctypes (#107131) 2023-07-31 09:10:53 +02:00
Ned Deily 68f94715bb
Update macOS installer screens to 3.13. (GH-107475) 2023-07-31 06:05:47 +00:00
Ned Deily 83e0976f89
gh-99079: Update macOS installer to use OpenSSL 3.0.9. (GH-107474) 2023-07-31 05:58:35 +00:00
Dong-hee Na a24e25d74b
gh-107427: Update the description of UNPACK_SEQUENCE (gh-107429) 2023-07-31 00:40:37 +09:00
Charlie Zhao 3979150a0d
gh-106263: Fix segfault in `signaldict_repr` in `_decimal` module (#106270)
Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
2023-07-30 13:58:54 +05:30
Alex Waygood 5113ed7a2b
gh-104683: Argument clinic: pass `clinic` as a parameter where possible (#107435) 2023-07-29 19:47:42 +01:00
Alex Waygood 6c74b2f669
gh-104683: Argument clinic: Make the `filename` parameter to `Clinic` required (#107439) 2023-07-29 19:46:52 +01:00
Kumar Aditya 2e9ddb943c
add Kumar Aditya as CODEOWNER for import.c (#107441) 2023-07-29 18:26:24 +00:00
da-woods f2abeb590d
Fix the documentation for PyCode_New add `qualname` parameter (#107186) 2023-07-29 23:11:40 +05:30
Rakesh Sabale 89fd4f4a3f
gh-107422: Remove outdated `TypedDict` example from typing docs (#107436) 2023-07-29 17:04:46 +00:00
Alex Waygood d0dcd27d3a
Improve the GitHub issue templates (#107150)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-29 15:42:44 +01:00
Alex Waygood 87de2fbb1e
gh-104050: Argument clinic: enable mypy's `--warn-return-any` setting (#107405) 2023-07-29 13:39:21 +01:00
Inada Naoki 37551c9cef
gh-107369: optimize textwrap.indent() (#107374) 2023-07-29 06:37:23 +00:00
Serhiy Storchaka f2d07d3289
gh-101100: Sphinx warnings: pick the low hanging fruits (GH-107386) 2023-07-29 08:48:10 +03:00
Serhiy Storchaka 413ba8943e
gh-107091: Fix some uses of :func: role (GH-107378)
:c:func: or :c:macro: should be used instead.
2023-07-29 08:43:10 +03:00
James Cave 810d5d87d9
gh-107089: Improve Shelf.clear method performance (gh-107090) 2023-07-29 09:08:11 +09:00
justdan6 11c055f5ff
gh-106881: Check for linux/limits.h before including it (#107397)
* Check for linux/limits.h before including it

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-07-28 15:08:43 -07:00
Eric Snow cf63df88d3
gh-107307: Update the importlib Docs for PEP 684 (gh-107400) 2023-07-28 16:00:03 -06:00
Eric Snow 8ba4df91ae
gh-105699: Use a _Py_hashtable_t for the PyModuleDef Cache (gh-106974)
This fixes a crasher due to a race condition, triggered infrequently when two isolated (own GIL) subinterpreters simultaneously initialize their sys or builtins modules.  The crash happened due the combination of the "detached" thread state we were using and the "last holder" logic we use for the GIL.  It turns out it's tricky to use the same thread state for different threads.  Who could have guessed?

We solve the problem by eliminating the one object we were still sharing between interpreters.  We replace it with a low-level hashtable, using the "raw" allocator to avoid tying it to the main interpreter.

We also remove the accommodations for "detached" thread states, which were a dubious idea to start with.
2023-07-28 14:39:08 -06:00
Alex Waygood 55ed85e49c
gh-104050: Argument clinic: complete type annotations (#107399) 2023-07-28 21:27:21 +01:00
Eric Snow c0b81c4b54
gh-107305: Update the C-API Docs for PEP 684 (gh-107324) 2023-07-28 13:46:55 -06:00
Alex Waygood ecc05e23a1
gh-106368: Argument clinic: Fix minor bug in `state_modulename_name` (#107387) 2023-07-28 19:10:45 +01:00
Erlend E. Aasland 3a1d819ebc
gh-104629: Build _testclinic extension module on Windows (#104723) 2023-07-28 18:31:30 +02:00
Mark Shannon 1ee605c588
GH-101291: Add warning to "what's new" that `PyLongObject` internals have changed. (GH-107388) 2023-07-28 17:07:33 +01:00
Tom Niget 2aaa83d5f5
Fix typo in comment (gh-107389) 2023-07-28 10:52:29 -04:00
Illia Volochii fc130c47da
gh-102509: Start initializing `ob_digit` of `_PyLongValue` (GH-102510) 2023-07-28 14:39:54 +01:00
Mark Shannon a1b679572e
GH-104580: Put `eval_breaker` back at the start of the interpreter state. (GH-107383) 2023-07-28 13:55:25 +01:00
Serhiy Storchaka 0aa58fa7a6
gh-107091: Fix some uses of :const: role (GH-107379)
It is for references, not for literals.
2023-07-28 13:26:28 +03:00
Charlie Zhao a43cc3fa1f
gh-106078: Isolate `decimal` module (#107287) 2023-07-28 11:28:14 +05:30
Felipe A. Hernandez 3dcac78581
gh-106723: forward -Xfrozen_modules option to spawned process interpreters (#106724)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-07-28 05:04:26 +00:00
Alex Waygood 76c26eaca4
gh-106368: Argument clinic tests: improve failure message when tests in `ClinicExternalTests` fail (#107364) 2023-07-27 23:57:55 +00:00
Alex Waygood c2b1689abc
gh-104683: Argument clinic: cleanup `state_modulename_name()` (#107340) 2023-07-27 22:51:18 +01:00
Eric Snow 2f9bb77764
gh-106931: Fix the WASM Buildbots (gh-107362)
Skip subinterpreter tests when not supported.
2023-07-27 21:46:02 +00:00
Eric Snow 8bdae1424b
gh-101524: Only Use Public C-API in the _xxsubinterpreters Module (gh-107359)
The _xxsubinterpreters module should not rely on internal API.  Some of the functions it uses were recently moved there however.  Here we move them back (and expose them properly).
2023-07-27 15:30:16 -06:00
Eric Snow 75c974f535
gh-104621: Check for Incompatible Extensions in import_find_extension() (gh-107184)
This fixes a bug where incompatible modules could still be imported if attempted multiple times.
2023-07-27 15:08:38 -06:00
Eric Snow b72947a8d2
gh-106931: Intern Statically Allocated Strings Globally (gh-107272)
We tried this before with a dict and for all interned strings.  That ran into problems due to interpreter isolation.  However, exclusively using a per-interpreter cache caused some inconsistency that can eliminate the benefit of interning.  Here we circle back to using a global cache, but only for statically allocated strings.  We also use a more-basic _Py_hashtable_t for that global cache instead of a dict.

Ideally we would only have the global cache, but the optional isolation of each interpreter's allocator means that a non-static string object must not outlive its interpreter.  Thus we would have to store a copy of each such interned string in the global cache, tied to the main interpreter.
2023-07-27 13:56:59 -06:00
Eric Snow 4f67921ad2
gh-105699: Disable the Interpreters Stress Tests (gh-107354)
The two tests are crashing periodically in CI and on buildbots.  I suspect the problem is in the _xxsubinterpreters module. 
 Regardless, I'm disabling the tests temporarily, to reduce the noise as we approach 3.12rc1.  I'll be investigating the crashes separately.
2023-07-27 19:39:26 +00:00
Christopher Chavez f01e4cedba
gh-104432: Use `memcpy()` to avoid misaligned loads (#104433)
Fix potential unaligned memory access on C APIs involving returned sequences
of `char *` pointers within the :mod:`grp` and :mod:`socket` modules. These
were revealed using a ``-fsaniziter=alignment`` build on ARM macOS.
2023-07-27 19:20:25 +00:00
Serhiy Storchaka 983305268e
gh-107298: Fix yet more Sphinx warnings in the C API doc (GH-107345) 2023-07-27 18:44:32 +03:00
Mark Shannon ac7a0f858a
GH-106898: Add the exception as an argument to the `PY_UNWIND` event callback function. (GH-107347) 2023-07-27 15:47:33 +01:00
Victor Stinner 9a7204b86b
gh-105268: _PyGC_FINALIZED() removal is already documented in 3.12 (#107350) 2023-07-27 14:43:09 +00:00
Victor Stinner 1dbb427dd6
gh-107196: Remove _PyArg_VaParseTupleAndKeywordsFast() function (#107197)
Remove the private _PyArg_VaParseTupleAndKeywordsFast() function: it
is no longer used.
2023-07-27 16:36:54 +02:00
Mark Shannon c6539b36c1
GH-106895: Raise a `ValueError` when attempting to disable events that cannot be disabled. (GH-107337) 2023-07-27 15:27:11 +01:00
Irit Katriel d77d973335
gh-105481: remove dependency of _inline_cache_entries on opname (#107339) 2023-07-27 14:15:25 +01:00