summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
...
* gh-117431: Adapt bytes and bytearray .find() and friends to Argument Clinic ↵Erlend E. Aasland2024-04-128-164/+703
| | | | | | | | | | | | | | (#117502) This change gives a significant speedup, as the METH_FASTCALL calling convention is now used. The following bytes and bytearray methods are adapted: - count() - find() - index() - rfind() - rindex() Co-authored-by: Inada Naoki <songofacandy@gmail.com>
* gh-117752: Autoconf: fix -fno-semantic-interposition check (#117789)Erlend E. Aasland2024-04-122-8/+8
| | | Force the compiler to issue an error if the flag is not supported.
* gh-117752: Autoconf: store all LLVM profile data in the build directory ↵Erlend E. Aasland2024-04-122-4/+4
| | | | | (#117790) This prevents spurious 'env changed' and llvm-profdata merge errors.
* gh-76785: Handle Legacy Interpreters Properly (gh-117490)Eric Snow2024-04-119-200/+454
| | | This is similar to the situation with threading._DummyThread. The methods (incl. __del__()) of interpreters.Interpreter objects must be careful with interpreters not created by interpreters.create(). The simplest thing to start with is to disable any method that modifies or runs in the interpreter. As part of this, the runtime keeps track of where an interpreter was created. We also handle interpreter "refcounts" properly.
* gh-117787: Autoconf: fix bashisms/semantic breakage of iOS checks (#117788)Eli Schwartz2024-04-112-2/+2
|
* gh-116738: Make _abc module thread-safe (#117488)Brett Simmers2024-04-113-115/+205
| | | | A collection of small changes aimed at making the `_abc` module safe to use in a free-threaded build.
* gh-117649: Fix file descriptor leak in (expected) failing test case (#117780)Sam Gross2024-04-111-0/+3
| | | | | The test case is currently expected to fail in the free-threaded build. However, it fails before it gets a chance to close the write end of the pipe.
* gh-117649: Raise ImportError for unsupported modules in free-threaded build ↵Sam Gross2024-04-119-32/+103
| | | | | | | | | | (#117651) The free-threaded build does not currently support the combination of single-phase init modules and non-isolated subinterpreters. Ensure that `check_multi_interp_extensions` is always `True` for subinterpreters in the free-threaded build so that importing these modules raises an `ImportError`.
* gh-111506: Error if the limited API is used in free-threaded build (#117762)Sam Gross2024-04-111-0/+5
| | | | Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED` are defined.
* gh-104269: Document `glob.glob` duplicates when using multiple `**` patterns ↵Tomas R2024-04-111-0/+8
| | | | (#105406)
* gh-117233: Detect support for several hashes at hashlib build time (GH-117234)Will Childs-Klein2024-04-112-10/+62
| | | | | | | | | | | | | | | | | | | | | | | Detect libcrypto BLAKE2, Shake, SHA3, and Truncated-SHA512 support at hashlib build time ## BLAKE2 While OpenSSL supports both "b" and "s" variants of the BLAKE2 hash function, other cryptographic libraries may lack support for one or both of the variants. This commit modifies `hashlib`'s C code to detect whether or not the linked libcrypto supports each BLAKE2 variant, and elides references to each variant's NID accordingly. In cases where the underlying libcrypto doesn't fully support BLAKE2, CPython's `./configure` script can be given the following flag to use CPython's interned BLAKE2 implementation: `--with-builtin-hashlib-hashes=blake2`. ## SHA3, Shake, & truncated SHA512. Detect BLAKE2, SHA3, Shake, & truncated SHA512 support in the OpenSSL-ish libcrypto library at build time. This helps allow hashlib's `_hashopenssl` to be used with libraries that do not to support every algorithm that upstream OpenSSL does. Such as AWS-LC & BoringSSL. Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
* gh-117722: Fix Stream.readuntil with non-bytes buffer objects (#117723)Bruce Merry2024-04-115-14/+27
| | | | | | | | | | | | | gh-16429 introduced support for an iterable of separators in Stream.readuntil. Since bytes-like types are themselves iterable, this can introduce ambiguities in deciding whether the argument is an iterator of separators or a singleton separator. In gh-16429, only 'bytes' was considered a singleton, but this will break code that passes other buffer object types. Fix it by only supporting tuples rather than arbitrary iterables. Closes gh-117722.
* gh-101549: fix documentation of xml.etree.ElementInclude (#101550)Mikhail B2024-04-112-26/+22
| | | | | Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
* gh-115142: Skip ``test_capi/test_opt.py`` if ``_testinternalcapi`` is not ↵Kirill Podoprigora2024-04-111-2/+3
| | | | available (GH-117574)
* Fix markup of `win32_ver` in `platform.rst` (#116492)Nikita Sobolev2024-04-111-2/+2
|
* gh-117709: Add vectorcall support for str() with positional-only arguments ↵Erlend E. Aasland2024-04-113-0/+72
| | | | | | | | (#117746) Fall back to tp_call() for cases when arguments are passed by name. Co-authored-by: Donghee Na <donghee.na@python.org> Co-authored-by: Victor Stinner <vstinner@python.org>
* gh-113317: Add ParseArgsCodeGen class (#117707)Victor Stinner2024-04-114-846/+953
|
* gh-113317: Add Codegen class to Argument Clinic (#117626)Victor Stinner2024-04-118-180/+183
| | | | | | | | | | | * Move ifndef_symbols, includes and add_include() from Clinic to Codegen. Add a 'codegen' (Codegen) attribute to Clinic. * Remove libclinic.crenderdata module: move code to libclinic.codegen. * BlockPrinter.print_block(): remove unused 'limited_capi' argument. Remove also 'core_includes' parameter. * Add get_includes() methods. * Make Codegen.ifndef_symbols private. * Make Codegen.includes private. * Make CConverter.includes private.
* gh-117711: Only check for 'test/wheeldata' when it's actually used (#117712)Karolina Surma2024-04-111-0/+4
| | | | | | | It's possible to build Python with option `--with-wheel-pkg-dir` pointing to a custom wheel directory. Don't include the directory in the test set if the wheels are used from a different location. Co-authored-by: Miro Hrončok <miro@hroncok.cz>
* gh-117606: Truncate extremely long error message in `test_exceptions` (#117670)Nice Zombies2024-04-111-1/+2
| | | Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-76785: Add More Tests to test_interpreters.test_api (gh-117662)Eric Snow2024-04-1118-418/+2012
| | | In addition to the increase test coverage, this is a precursor to sorting out how we handle interpreters created directly via the C-API.
* GH-117586: Speed up `pathlib.Path.walk()` by working with strings (#117726)Barney Gale2024-04-114-71/+52
| | | | | | | | | | | Move `pathlib.Path.walk()` implementation into `glob._Globber`. The new `glob._Globber.walk()` classmethod works with strings internally, which is a little faster than generating `Path` objects and keeping them normalized. The `pathlib.Path.walk()` method converts the strings back to path objects. In the private pathlib ABCs, our existing subclass of `_Globber` ensures that `PathBase` instances are used throughout. Follow-up to #117589.
* GH-117586: Speed up `pathlib.Path.glob()` by working with strings (#117589)Barney Gale2024-04-104-195/+269
| | | | | | | | | | | | Move pathlib globbing implementation into a new private class: `glob._Globber`. This class implements fast string-based globbing. It's called by `pathlib.Path.glob()`, which then converts strings back to path objects. In the private pathlib ABCs, add a `pathlib._abc.Globber` subclass that works with `PathBase` objects rather than strings, and calls user-defined path methods like `PathBase.stat()` rather than `os.stat()`. This sets the stage for two more improvements: - GH-115060: Query non-wildcard segments with `lstat()` - GH-116380: Unify `pathlib` and `glob` implementations of globbing. No change to the implementations of `glob.glob()` and `glob.iglob()`.
* gh-67224: Make linecache imports relative to improve startup speed (#117501)Pablo Galindo Salgado2024-04-101-3/+11
|
* GH-117546: Fix symlink resolution in `os.path.realpath('loop/../link')` ↵Barney Gale2024-04-104-17/+7
| | | | | | (#117568) Continue resolving symlink targets after encountering a symlink loop, which matches coreutils `realpath` behaviour.
* gh-117531: Unblock getters after non-immediate queue shutdown (#117532)Laurie O2024-04-103-5/+26
| | | (This is a small tweak of the original gh-104750 which added shutdown.)
* gh-115142: Skip ``test_capi.test_dict.py`` if ``_testcapi`` and ↵Kirill Podoprigora2024-04-101-2/+5
| | | | | ``_testlimitedcapi`` are not available (GH-117588) gh-115142: Skip test_dict if _testcapi and _testlimitedcapi is not available
* gh-112536: Define `_Py_THREAD_SANITIZER` on GCC when TSan is enabled (#117702)Sam Gross2024-04-101-0/+3
| | | | | The `__has_feature(thread_sanitizer)` is a Clang-ism. Although new versions of GCC implement `__has_feature`, the `defined(__has_feature)` check still fails on GCC so we don't use that code path.
* gh-117142: Port _ctypes to multi-phase init (GH-117181)neonene2024-04-1010-178/+1125
|
* gh-117692: Fix `AttributeError` in `DocTestFinder` on wrapped ↵Nikita Sobolev2024-04-103-1/+24
| | | | | | `builtin_or_method` (#117699) Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
* gh-117686: Improve the performance of ntpath.expanduser() (#117690)Nice Zombies2024-04-102-2/+4
| | | Refactor out _get_bothseps() call from the loop.
* gh-117431: Argument Clinic: copy forced text signature when cloning (#117591)Erlend E. Aasland2024-04-104-10/+70
|
* gh-117360: Clearer wording in os.path.lexists() docs (#117679)Nice Zombies2024-04-091-1/+1
| | | Co-authored-by: Zachary Ware <zach@python.org>
* gh-117597: Clarify exception handling in the tutorial (#117681)Nice Zombies2024-04-091-3/+3
|
* gh-117648: Amend NEWS entry (#117697)Erlend E. Aasland2024-04-091-1/+1
| | | | Make the wording more vague; the performance impact varies a lot depending on platform and input.
* Merge branch 'main' of https://github.com/python/cpythonThomas Wouters2024-04-0921-92/+548
|\
| * gh-117663: [Enum] fix _simple_enum's detection of aliases (GH-117664)Ethan Furman2024-04-093-29/+97
| |
| * gh-117534: Add checking for input parameter in iso_to_ymd (#117543)Vlad48962024-04-094-7/+16
| | | | | | | | | | | | | | Moves the validation for invalid years in the C implementation of the `datetime` module into a common location between `fromisoformat` and `fromisocalendar`, which improves the error message and fixes a failed assertion when parsing invalid ISO 8601 years using one of the "ISO weeks" formats. --------- Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
| * Revert "gh-106023: Update What's New in 3.13: _PyObject_FastCall() ↵Victor Stinner2024-04-091-0/+5
| | | | | | | | | | | | | | | | (#117633)" (#117676) This reverts commit 9a12f5d1c19dee1f89684be776680aeaf117be5b. I was wrong: the _PyObject_FastCall() function was removed. But we kept the _PyObject_FastCallDict() function.
| * gh-117658: Fix check_dump_traceback_threads in free-threaded build (#117659)Sam Gross2024-04-091-1/+3
| | | | | | | | With the GIL disabled, the waiting thread may still be in the `self.running.set() ` call when faulthandler dumps tracebacks.
| * gh-116720: Fix corner cases of taskgroups (#117407)Guido van Rossum2024-04-098-13/+183
| | | | | | | | | | | | | | | | | | | | This prevents external cancellations of a task group's parent task to be dropped when an internal cancellation happens at the same time. Also strengthen the semantics of uncancel() to clear self._must_cancel when the cancellation count reaches zero. Co-Authored-By: Tin Tvrtković <tinchester@gmail.com> Co-Authored-By: Arthur Tacca
| * gh-116622: Enable `test_doctest` on platforms that don't support ↵Malcolm Smith2024-04-091-3/+8
| | | | | | | | | | subprocesses (#116758) Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
| * gh-117516: Implement typing.TypeIs (#117517)Jelle Zijlstra2024-04-095-39/+236
| | | | | | | | | | | | See PEP 742. Co-authored-by: Carl Meyer <carl@oddbird.net> Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
* | Post 3.13.0a6Thomas Wouters2024-04-091-1/+1
| |
* | Python 3.13.0a6v3.13.0a6Thomas Wouters2024-04-09122-346/+1315
|/
* gh-107674: Remove some unnecessary code in instrumentation code (GH-117393)Tian Gao2024-04-091-1/+1
|
* gh-117648: Improve performance of os.join (#117654)Nice Zombies2024-04-093-2/+4
| | | | | Replace map() with a method call in the loop body. Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
* gh-117182: Allow lazily loaded modules to modify their own __class__Chris Markiewicz2024-04-093-4/+38
|
* gh-117645: Skip test_dynamic global specialization on WASI (#117646)Victor Stinner2024-04-081-2/+2
| | | | Skip test_load_global_specialization_failure_keeps_oparg() of test_dynamic on WASI build. The test uses too much stack memory.
* Enhance regrtest get_signal_name(): support shell exit code (#117647)Victor Stinner2024-04-082-0/+9
|