| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
(#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>
|
|
|
| |
Force the compiler to issue an error if the flag is not supported.
|
|
|
|
|
| |
(#117790)
This prevents spurious 'env changed' and llvm-profdata merge errors.
|
|
|
| |
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.
|
| |
|
|
|
|
| |
A collection of small changes aimed at making the `_abc` module safe to
use in a free-threaded build.
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
| |
(#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`.
|
|
|
|
| |
Issue a build time error if both `Py_LIMITED_API` and `Py_GIL_DISABLED`
are defined.
|
|
|
|
| |
(#105406)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
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-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.
|
|
|
|
|
| |
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
|
|
|
|
| |
available (GH-117574)
|
| |
|
|
|
|
|
|
|
|
| |
(#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>
|
| |
|
|
|
|
|
|
|
|
|
|
|
| |
* 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.
|
|
|
|
|
|
|
| |
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>
|
|
|
| |
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
| |
In addition to the increase test coverage, this is a precursor to sorting out how we handle interpreters created directly via the C-API.
|
|
|
|
|
|
|
|
|
|
|
| |
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.
|
|
|
|
|
|
|
|
|
|
|
|
| |
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()`.
|
| |
|
|
|
|
|
|
| |
(#117568)
Continue resolving symlink targets after encountering a symlink loop, which
matches coreutils `realpath` behaviour.
|
|
|
| |
(This is a small tweak of the original gh-104750 which added shutdown.)
|
|
|
|
|
| |
``_testlimitedcapi`` are not available (GH-117588)
gh-115142: Skip test_dict if _testcapi and _testlimitedcapi is not available
|
|
|
|
|
| |
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.
|
| |
|
|
|
|
|
|
| |
`builtin_or_method` (#117699)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
|
|
|
| |
Refactor out _get_bothseps() call from the loop.
|
| |
|
|
|
| |
Co-authored-by: Zachary Ware <zach@python.org>
|
| |
|
|
|
|
| |
Make the wording more vague; the performance impact varies a lot
depending on platform and input.
|
|\ |
|
| | |
|
| |
| |
| |
| |
| |
| |
| | |
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>
|
| |
| |
| |
| |
| |
| |
| |
| | |
(#117633)" (#117676)
This reverts commit 9a12f5d1c19dee1f89684be776680aeaf117be5b.
I was wrong: the _PyObject_FastCall() function was removed. But we
kept the _PyObject_FastCallDict() function.
|
| |
| |
| |
| | |
With the GIL disabled, the waiting thread may still be in the
`self.running.set() ` call when faulthandler dumps tracebacks.
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
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
|
| |
| |
| |
| |
| | |
subprocesses (#116758)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
|
| |
| |
| |
| |
| |
| | |
See PEP 742.
Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
|
| | |
|
|/ |
|
| |
|
|
|
|
|
| |
Replace map() with a method call in the loop body.
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
|
| |
|
|
|
|
| |
Skip test_load_global_specialization_failure_keeps_oparg() of
test_dynamic on WASI build. The test uses too much stack memory.
|
| |
|