summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Minor markup and grammar fixes in the statistics docs (gh-117216)Raymond Hettinger2024-03-251-3/+3
|
* gh-117176: Fix compiler warning in Python/optimizer_bytecodes.c (GH-117199)Kirill Podoprigora2024-03-242-2/+2
|
* gh-112571: Move fish venv activation script into the common folder (GH-117169)Totally a booplicate2024-03-241-0/+0
| | | | | | | pythongh-112571: allow using fish venv activation script on windows The fish shell can be used on windows under cygwin or msys2. This change moves the script to the common folder so the venv module will install it on both posix and nt systems (like the bash script).
* gh-117194: Properly format 'base64' header in What's New (#117198)Terry Jan Reedy2024-03-241-1/+1
| | | It needs 6, not 3, '-'s.
* GH-115986 Docs: promote pprint.pp usage as a default (#116614)Kerim Kabirov2024-03-241-15/+18
| | | | Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* gh-101760: Improve the imaplib.IMAP4 example (#101764)LilKS2024-03-241-1/+1
| | | | Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* Add cumulative option for the new statistics.kde() function. (#117033)Raymond Hettinger2024-03-243-21/+75
|
* gh-112383: teach dis how to interpret ENTER_EXECUTOR (#117171)Irit Katriel2024-03-237-50/+120
|
* gh-117180: Complete call sequence when trace stack overflow (GH-117184)Ken Jin2024-03-232-0/+27
| | | | | | | --------- Co-authored-by: Peter Lazorchak <lazorchakp@gmail.com> Co-authored-by: Guido van Rossum <gvanrossum@users.noreply.github.com> Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
* gh-91227: Ignore ERROR_PORT_UNREACHABLE in proactor recvfrom() (#32011)Erik Soma2024-03-235-12/+174
|
* gh-117008: Fix functools test_recursive_pickle() (#117009)Victor Stinner2024-03-232-2/+6
| | | | | | | Use support.infinite_recursion() in test_recursive_pickle() of test_functools to prevent a stack overflow on "ARM64 Windows Non-Debug" buildbot. Lower Py_C_RECURSION_LIMIT to 1,000 frames on Windows ARM64.
* GH-106747: Document another difference between `glob` and `pathlib`. (#116518)Barney Gale2024-03-221-0/+4
| | | | | Document that `path.glob()` might return *path*, whereas `glob.glob(root_dir=path)` will never return an empty string corresponding to *path*.
* GH-117108: Change the size of the GC increment to about 1% of the total heap ↵Mark Shannon2024-03-226-28/+47
| | | | size. (GH-117120)
* gh-113024: C API: Add PyObject_GenericHash() function (GH-113025)Serhiy Storchaka2024-03-2214-13/+51
|
* gh-117084: Fix ZIP file extraction for directory entry names with ↵Serhiy Storchaka2024-03-224-1/+27
| | | | backslashes on Windows (GH-117129)
* gh-117134: Microoptimize glob() for include_hidden=True (GH-117135)Serhiy Storchaka2024-03-221-2/+2
|
* [docs] Fix typo in docstring and add example to logging cookbook. (GH-117157)Vinay Sajip2024-03-222-15/+127
|
* GH-113171: Fix "private" (non-global) IP address ranges (GH-113179)Jakub Stasiak2024-03-225-7/+82
| | | | | | | | | | | | | | | | | | | | | * GH-113171: Fix "private" (really non-global) IP address ranges The _private_networks variables, used by various is_private implementations, were missing some ranges and at the same time had overly strict ranges (where there are more specific ranges considered globally reachable by the IANA registries). This patch updates the ranges with what was missing or otherwise incorrect. I left 100.64.0.0/10 alone, for now, as it's been made special in [1] and I'm not sure if we want to undo that as I don't quite understand the motivation behind it. The _address_exclude_many() call returns 8 networks for IPv4, 121 networks for IPv6. [1] https://github.com/python/cpython/issues/61602
* Fix get_packagefamilyname helper function on Windows 32-bit (GH-117153)Steve Dower2024-03-221-1/+1
|
* gh-117068: Remove useless code in bytesio.c:resize_buffer() (GH-117069)NGRsoftlab2024-03-221-3/+0
| | | Co-authored-by: i.khabibulin <i.khabibulin@ngrsoftlab.ru>
* gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128)Petr Viktorin2024-03-221-0/+9
|
* GH-116939: Rewrite binarysort() (#116940)Tim Peters2024-03-222-66/+141
| | | | | | | | | | | | | | | | | | | | | | | | Rewrote binarysort() for clarity. Also changed the signature to be more coherent (it was mixing sortslice with raw pointers). No change in method or functionality. However, I left some experiments in, disabled for now via `#if` tricks. Since this code was first written, some kinds of comparisons have gotten enormously faster (like for lists of floats), which changes the tradeoffs. For example, plain insertion sort's simpler innermost loop and highly predictable branches leave it very competitive (even beating, by a bit) binary insertion when comparisons are very cheap, despite that it can do many more compares. And it wins big on runs that are already sorted (moving the next one in takes only 1 compare then). So I left code for a plain insertion sort, to make future experimenting easier. Also made the maximum value of minrun a `#define` (``MAX_MINRUN`) to make experimenting with that easier too. And another bit of `#if``-disabled code rewrites binary insertion's innermost loop to remove its unpredictable branch. Surprisingly, this doesn't really seem to help overall. I'm unclear on why not. It certainly adds more instructions, but they're very simple, and it's hard to be believe they cost as much as a branch miss.
* gh-108716:: Remove _PyStaticCode_Init/Fini (#117141)Guido van Rossum2024-03-221-46/+0
| | | More deepfreeze cleanup.
* gh-105716: Fix _PyInterpreterState_IsRunningMain() For Embedders (gh-117140)Eric Snow2024-03-223-22/+39
| | | | | When I added _PyInterpreterState_IsRunningMain() and friends last year, I tried to accommodate applications that embed Python but don't call _PyInterpreterState_SetRunningMain() (not that they're expected to). That mostly worked fine until my recent changes in gh-117049, where the subtleties with the fallback code led to failures; the change ended up breaking test_tools.test_freeze, which exercises a basic embedding situation. The simplest fix is to drop the fallback code I originally added to _PyInterpreterState_IsRunningMain() (and later to _PyThreadState_IsRunningMain()). I've kept the fallback in the _xxsubinterpreters module though. I've also updated Py_FrozenMain() to call _PyInterpreterState_SetRunningMain().
* gh-116745: Remove all internal usage of @LIBPYTHON@ (#116746)Thomas A Caswell2024-03-212-2/+2
| | | Replace with MODULE_LDFLAGS.
* gh-71052: Add Android build script and instructions (#116426)Malcolm Smith2024-03-217-19/+403
|
* gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (#117126)Victor Stinner2024-03-211-1/+10
| | | On RHEL9, sched_setaffinity(0, []) does not fail.
* docs: fix over-linking in dataclasses.rst (#117005)Ned Batchelder2024-03-211-78/+80
|
* gh-117045: Add code object to function version cache (#117028)Guido van Rossum2024-03-218-96/+209
| | | | | | | | | | | | | | | | | | | | | | | | | | Changes to the function version cache: - In addition to the function object, also store the code object, and allow the latter to be retrieved even if the function has been evicted. - Stop assigning new function versions after a critical attribute (e.g. `__code__`) has been modified; the version is permanently reset to zero in this case. - Changes to `__annotations__` are no longer considered critical. (This fixes gh-109998.) Changes to the Tier 2 optimization machinery: - If we cannot map a function version to a function, but it is still mapped to a code object, we continue projecting the trace. The operand of the `_PUSH_FRAME` and `_POP_FRAME` opcodes can be either NULL, a function object, or a code object with the lowest bit set. This allows us to trace through code that calls an ephemeral function, i.e., a function that may not be alive when we are constructing the executor, e.g. a generator expression or certain nested functions. We will lose globals removal inside such functions, but we can still do other peephole operations (and even possibly [call inlining](https://github.com/python/cpython/pull/116290), if we decide to do it), which only need the code object. As before, if we cannot retrieve the code object from the cache, we stop projecting.
* gh-116333: Relax error string text expectations in SSL-related tests (GH-116334)Will Childs-Klein2024-03-214-38/+96
| | | | | | | | | | | | | | | | | | | * Relax error string text expectations in SSL-related tests As suggested [here][1], this change relaxes the OpenSSL error string text expectations in a number of tests. This was specifically done in support of more easily building CPython [AWS-LC][2], but because AWS-LC is a fork of [BoringSSL][3], it should increase compatibility with that library as well. In addition to the error string relaxations, we also add some guards around the `tls-unique` channel binding being used with TLSv1.3, as that feature (described in [RFC 6929][4]) is [not defined][5] for TLSv1.3. [1]: https://discuss.python.org/t/support-building-ssl-and-hashlib-modules-against-aws-lc/44505/4 [2]: https://github.com/aws/aws-lc [3]: https://github.com/google/boringssl [4]: https://datatracker.ietf.org/doc/html/rfc5929#section-3 [5]: https://datatracker.ietf.org/doc/html/rfc8446#appendix-C.5
* gh-116522: Refactor `_PyThreadState_DeleteExcept` (#117131)Sam Gross2024-03-215-23/+41
| | | | | | | | | | | Split `_PyThreadState_DeleteExcept` into two functions: - `_PyThreadState_RemoveExcept` removes all thread states other than one passed as an argument. It returns the removed thread states as a linked list. - `_PyThreadState_DeleteList` deletes those dead thread states. It may call destructors, so we want to "start the world" before calling `_PyThreadState_DeleteList` to avoid potential deadlocks.
* gh-116996: Add pystats about _Py_uop_analyse_and_optimize (GH-116997)Michael Droettboom2024-03-215-3/+56
|
* gh-76785: Drop PyInterpreterID_Type (gh-117101)Eric Snow2024-03-2118-449/+363
| | | I added it quite a while ago as a strategy for managing interpreter lifetimes relative to the PEP 554 (now 734) implementation. Relatively recently I refactored that implementation to no longer rely on InterpreterID objects. Thus now I'm removing it.
* gh-85283: Build _testconsole extension with limited C API (#117125)Victor Stinner2024-03-214-98/+43
|
* gh-115754: Add Py_GetConstant() function (#116883)Victor Stinner2024-03-2122-6/+312
| | | | | | | | | | | | Add Py_GetConstant() and Py_GetConstantBorrowed() functions. In the limited C API version 3.13, getting Py_None, Py_False, Py_True, Py_Ellipsis and Py_NotImplemented singletons is now implemented as function calls at the stable ABI level to hide implementation details. Getting these constants still return borrowed references. Add _testlimitedcapi/object.c and test_capi/test_object.py to test Py_GetConstant() and Py_GetConstantBorrowed() functions.
* gh-105716: Update interp->threads.main After Fork (gh-117049)Eric Snow2024-03-214-0/+46
| | | | | I missed this in gh-109921. We also update Py_Exit() to call _PyInterpreterState_SetNotRunningMain(), if necessary.
* gh-76785: Clean Up Interpreter ID Conversions (gh-117048)Eric Snow2024-03-218-178/+143
| | | Mostly we unify the two different implementations of the conversion code (from PyObject * to int64_t. We also drop the PyArg_ParseTuple()-style converter function, as well as rename and move PyInterpreterID_LookUp().
* gh-116522: Stop the world before fork() and during shutdown (#116607)Sam Gross2024-03-213-7/+30
| | | | | | | | | | | This changes the free-threaded build to perform a stop-the-world pause before deleting other thread states when forking and during shutdown. This fixes some crashes when using multiprocessing and during shutdown when running with `PYTHON_GIL=0`. This also changes `PyOS_BeforeFork` to acquire the runtime lock (i.e., `HEAD_LOCK(&_PyRuntime)`) before forking to ensure that data protected by the runtime lock (and not just the GIL or stop-the-world) is in a consistent state before forking.
* gh-71052: Implement `ctypes.util.find_library` on Android (GH-116379)Malcolm Smith2024-03-214-2/+36
|
* gh-116987: Support class code objects in inspect.findsource() (GH-117025)Tian Gao2024-03-214-9/+11
|
* GH-109653: Defer import of ``importlib.metadata._adapters`` (#109829)Adam Turner2024-03-213-3/+9
| | | | | | | | | | | * adapters * Add comments for deferred imports with links to rationale. * Add blurb --------- Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* gh-117089: Apply changes from importlib_metadata 7.1.0 (#117094)Jason R. Coombs2024-03-2110-95/+212
| | | | | * Apply changes from importlib_metadata 7.1.0 * Include the data sources in the makefile (even though they're not needed)
* gh-116869: Enable -Werror in test_cext for Free Threading (#117106)Victor Stinner2024-03-201-5/+7
| | | | Check for warnings, but don't enable the compiler flag -Werror=declaration-after-statement.
* gh-105927: Limit PyWeakref_GetRef() to limited C API 3.13 (#117091)Victor Stinner2024-03-201-0/+3
|
* gh-117089: Move importlib.metadata tests to their own package (#117092)Jason R. Coombs2024-03-2015-3/+7
| | | | | | | | | * Ensure importlib.metadata tests do not leak references in sys.modules. * Move importlib.metadata tests to their own package for easier syncing with importlib_metadata. * Update owners and makefile for new directories. * Add blurb
* Fix sort order for "locale encoding" glossary item (#115794)Carol Willing2024-03-201-12/+12
| | | | Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
* GH-117066: Tier 2 optimizer: Don't throw away good traces if we can't ↵Mark Shannon2024-03-203-8/+16
| | | | optimize them perfectly. (GH-117067)
* gh-114314: ctypes: remove stgdict and switch to heap types (GH-116458)Petr Viktorin2024-03-2015-1411/+1496
| | | | | | | | | | | | | | | | | | | | | | | | | | | Before this change, ctypes classes used a custom dict subclass, `StgDict`, as their `tp_dict`. This acts like a regular dict but also includes extra information about the type. This replaces stgdict by `StgInfo`, a C struct on the type, accessed by `PyObject_GetTypeData()` (PEP-697). All usage of `StgDict` (mainly variables named `stgdict`, `dict`, `edict` etc.) is converted to `StgInfo` (named `stginfo`, `info`, `einfo`, etc.). Where the dict is actually used for class attributes (as a regular PyDict), it's now called `attrdict`. This change -- not overriding `tp_dict` -- is made to make me comfortable with the next part of this PR: moving the initialization logic from `tp_new` to `tp_init`. The `StgInfo` is set up in `__init__` of each class, with a guard that prevents calling `__init__` more than once. Note that abstract classes (like `Array` or `Structure`) are created using `PyType_FromMetaclass` and do not have `__init__` called. Previously, this was done in `__new__`, which also wasn't called for abstract classes. Since `__init__` can be called from Python code or skipped, there is a tested guard to ensure `StgInfo` is initialized exactly once before it's used. Co-authored-by: neonene <53406459+neonene@users.noreply.github.com> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-117058: Update GUI and packaging recommendations for macOS. (#117059)Russell Keith-Magee2024-03-201-11/+25
|
* gh-116908: Only write to `_pending_calls.calls_to_do` with atomic operations ↵Brett Simmers2024-03-201-2/+2
| | | | | | (#117044) These writes to `pending->calls_to_do` need to be atomic, because other threads can read (atomically) from `calls_to_do` without holding `pending->mutex`.