125963 Commits

Author SHA1 Message Date
Sam Gross
7ffe93faf1
gh-131121: Fix _Py_atomic_store_char_relaxed memory order (gh-131122) 2025-03-12 09:03:04 -04:00
Pieter Eendebak
1fb7e2aeb7
gh-120608: Make reversed iterator work with free-threading (#120971)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2025-03-12 12:39:52 +01:00
Victor Stinner
4dcbe06fd2
gh-111178: Fix type of PyCMethod's "nargs" argument (GH-131135)
Replace "size_t nargs" with "Py_ssize_t nargs" in PyCMethod.
2025-03-12 11:54:02 +01:00
Daniel Pope
e0637cebe5
gh-129349: Accept bytes in bytes.fromhex()/bytearray.fromhex() (#129844)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-12 11:40:11 +01:00
Pieter Eendebak
405a2d74cb
gh-123471: make itertools.batched thread-safe (#129416) 2025-03-12 15:30:33 +05:30
Stan Ulbrych
155c44b901
gh-81267: Correct time.sleep() error message (#131055) 2025-03-12 08:12:57 +00:00
donBarbos
15a8412b5e
gh-93096: Load doctests in test_itertools (#131133) 2025-03-12 08:40:59 +01:00
Victor Stinner
48cca72a7f
gh-111178: Fix function signatures in rangeobject.c (#131101) 2025-03-12 07:29:20 +01:00
Sergey B Kirpichev
52756c30db
Use subTest() in math.fma() tests (#131125) 2025-03-12 07:22:28 +01:00
Pablo Galindo Salgado
ebc24d54bc
gh-117174: Fix reference leak and gdb tests (#131095) 2025-03-11 23:17:58 +00:00
Sam Gross
c00ac57824
gh-131113: Fix data race in dict.popitem() (gh-131115)
The clearing of the key, hash, and value need to use atomic operations
to avoid a data race with concurrent read operations.
2025-03-11 19:15:22 -04:00
Barney Gale
ad90c5fabc
GH-130614: pathlib ABCs: revise test suite for readable paths (#131018)
Test `pathlib.types._ReadablePath` in a dedicated test module. These tests
cover `ReadableZipPath`, `ReadableLocalPath` and `Path`, where the former
two classes are implementations of `_ReadablePath` for use in tests.
2025-03-11 20:54:22 +00:00
Kumar Aditya
24070492cf
gh-128002: add test_asyncio.test_free_threading to tsan tests (#131106) 2025-03-12 01:33:44 +05:30
Kumar Aditya
fcf756adef
fix various warnings in test_asyncio.test_tasks (#131109) 2025-03-11 19:51:53 +00:00
Tian Gao
8b1edae93a
gh-122029: Do not unpack method for legacy tracing anymore (#130898) 2025-03-11 14:04:22 -04:00
Barney Gale
3569e4a670
GH-130614: pathlib ABCs: revise test suite for Windows path joining (#131016)
Test Windows-flavoured `pathlib.types._JoinablePath` in a dedicated test
module. These tests cover `LexicalWindowsPath`, `PureWindowsPath` and
`WindowsPath`, where `LexicalWindowsPath` is a simple implementation of
`_JoinablePath` for use in tests.
2025-03-11 18:01:43 +00:00
Gerardwx
e0bc9d2a0c
Replace link to historical TypedDict PEP with current document on typing.python… (#131096)
* Replace link to historical PEP with current document on typing.python.org

* Update Doc/library/typing.rst

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>

---------

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2025-03-11 12:45:31 -04:00
Victor Stinner
9d759b63d8
gh-111178: Change Argument Clinic signature for METH_O (#130682)
Use "PyObject*" for METH_O functions to fix an undefined behavior.
2025-03-11 16:33:36 +01:00
Sam Gross
4162bc133b
gh-130396: Fix thread sanitizer crashes on stack overflow tests (gh-130966)
Thread sanitizer will often crash if a test uses more than half the
stack.
2025-03-11 10:33:23 -04:00
Sam Gross
1908115871
gh-130957: Use sleeping_retry in test_free_reference (#130958)
The weak reference may not be immediately dead.
2025-03-11 09:51:26 -04:00
Max Bachmann
44c55c2356
Replace K&R function declarations with ANSI declarations (#114818) 2025-03-11 13:06:36 +01:00
Mark Shannon
6e5b9f3d00
GH-127705: Check for immortality in refcount accounting (#131072)
Check for immortality in refcount accounting
2025-03-11 11:53:07 +00:00
Max Bachmann
de8818ae23
gh-131082: Add missing guards for WIN32_LEAN_AND_MEAN (#131044)
* Add missing guards for WIN32_LEAN_AND_MEAN

* add missing whitespaces
2025-03-11 12:33:01 +01:00
donBarbos
425e0af74f
gh-93096: Remove -t and -v flags from pickle cli (#131068)
* Remove `python -m pickle -t`

* Revert adding doctest to unittests
2025-03-11 12:07:00 +01:00
donBarbos
3ddf983afd
gh-93096: Remove -t and -v flags from pickletools cli (#131039)
Remove `python -m pickletools -t`
2025-03-11 12:06:26 +01:00
donBarbos
3bb20d13a8
gh-93096: Load doctests in test_pickle (#131069)
Add doctests to unittest for `pickle`
2025-03-11 12:25:25 +02:00
Petr Viktorin
ad0f618ab3
gh-129675: Update documentation for tp_basicsize & tp_itemsize (#129850)
* Update documentation for tp_basicsize & tp_itemsize

- Add alignment requirement
- Mention that ob_size is unreliable if you don't control it
- Add some links for context
- basicsize should include the base type in generaly not just PyObject

This adds a “by-the-way” link to `PyObject_New`, which shouldn't be
used for GC types. In order to be comfortable linking to it, I also
add a link to `PyObject_GC_New` from its docs. And the same for
`*Var` variants, while I'm here.

* Strongly suggest Py_SIZE & Py_SET_SIZE
2025-03-11 11:21:18 +01:00
RUANG (James Roy)
faadb446d9
gh-46236: Add missing PyUnicode_Append() doc (#130531)
* Add missing PyUnicode_Append() doc

* Change the copied content

* Add '`` ``'

* Change doc

* Add PyUnicode_AppendAndDel function doc

* Change doc

* Add PyUnicode_AppendAndDel to refcounts

* Change doc

* Change doc

Co-authored-by: Petr Viktorin <encukou@gmail.com>

* Change doc

---------

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-11 10:28:17 +01:00
Michał Górny
33494b4d0d
gh-130959: Reject whitespace in fractions, in pure Python fromisoformat() (#130962)
* gh-130959: Reject whitespace in fractions, in pure Python `fromisoformat()`

Fix the pure Python implementation of `fromisoformat()` to reject any
non-digit characters, including whitespace, in the fractional part
of time specification.  This makes the behavior consistent with the C
implementation, and prevents incorrect parsing of these fractions
(e.g. `.400 ` would be misinterpreted as `.04`).

* Add the news entry

* Use a different example to fix Sphinx lint

* Apply suggestions from code review

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>

* Try fixing `:func:` ref.

---------

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-03-11 10:15:40 +01:00
Jakub Kulík
69309a55bc
gh-130932: cwd cannot be removed on Solaris/Illumos (#131037) 2025-03-11 10:09:04 +01:00
Ken Jin
fe186d76cf
Minor nits to whats new tail call wording (#130912) 2025-03-11 10:57:35 +08:00
Ken Jin
a8ee1e16f5
gh-130039: Tailcall for windows builds (GH-130040)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-11 10:52:56 +08:00
Pablo Galindo Salgado
4192ce17ba
gh-117174: Adapt test_multiple_statements_fail_early now that we have always source (#131065) 2025-03-10 23:10:53 +00:00
Sergey Miryanov
7c98b0674d
gh-130804: Fix support of typing unicode chars in pyrepl (#130805) 2025-03-10 22:13:50 +00:00
FeH2
6ab5c4aa05
gh-124927: Fix conversion issue between coordinates and position in REPL (#125001) 2025-03-10 21:54:49 +00:00
Pablo Galindo Salgado
a931a8b324
gh-117174: Add a new route in linecache to fetch interactive source code (#117500) 2025-03-10 21:54:05 +00:00
stratakis
ecdf6b15b0
gh-118518: Minor improvements to perf docs (#130866)
Minor improvements to perf docs
2025-03-10 21:51:21 +00:00
Pablo Galindo Salgado
fd3b49e85d
gh-128515: Properly check for bolt in test_perf_profiler (#131058) 2025-03-10 21:48:03 +00:00
Ammar Askar
8431b1fee8
Add Ammar to CODEOWNERS for fuzzing (#131057) 2025-03-10 13:58:36 -07:00
Chris Eibl
36ef3bfe39
gh-131020: py.exe launcher does not correctly detect a BOM when searching for the shebang (GH-131021) 2025-03-10 17:59:23 +00:00
Barney Gale
5a484714c3
GH-130614: pathlib ABCs: revise test suite for Posix path joining (#131017)
Test Posix-flavoured `pathlib.types._JoinablePath` in a dedicated test
module. These tests cover `LexicalPosixPath`, `PurePosixPath` and
`PosixPath`, where `LexicalPosixPath` is a simple implementation of
`_JoinablePath` for use in tests.
2025-03-10 17:59:10 +00:00
Barney Gale
93fc3d34f9
GH-127381: pathlib ABCs: remove case_sensitive argument (#131024)
Remove the *case_sensitive* argument from `_JoinablePath.full_match()` and
`_ReadablePath.glob()`. Using a non-native case sensitivity forces the use
of "case-pedantic" globbing, where we `iterdir()` even for non-wildcard
pattern segments. But it's hard to know when to enable this mode, as
case-sensitivity can vary by directory, so `_PathParser.normcase()` doesn't
always give the full picture. The `Path.glob()` implementation is forced to
make an educated guess, but we can avoid the issue in the ABCs by dropping
the *case_sensitive* argument.

(I probably shouldn't have added these arguments in `PurePath` and `Path`
in the first place!)

Also drop support for `_ReadablePath.glob(recurse_symlinks=False)`, which
makes recursive globbing much slower.
2025-03-10 17:50:48 +00:00
Jean-Christophe Fillion-Robin
c3487c941d
gh-82909: Update PC/pyconfig.h to allow disabling pragma based auto-linking (GH-19740)
Define Py_NO_LINK_LIB to build extension disabling pragma based auto-linking. This is relevant when using build-system generator (e.g CMake) where the linking is explicitly handled
2025-03-10 17:40:17 +00:00
Mark Shannon
be046ee6e0
GH-123044: Give the POP_TOP after a case test a location in the body, not the pattern. (GH-130627) 2025-03-10 17:31:16 +00:00
Chris Eibl
91d6db7ee0
GH-131035: Use -flto=thin for clang-cl on Windows (GH-131036) 2025-03-10 16:47:45 +00:00
Mark Shannon
2bef8ea8ea
GH-127705: Use _PyStackRefs in the default build. (GH-127875) 2025-03-10 14:06:56 +00:00
Yuki Kobayashi
7cc99a54b7
gh-101100: Fix sphinx warnings in library/asyncio-subprocess.rst (#130994) 2025-03-10 12:38:08 +00:00
Stan Ulbrych
98fa4a49fe
gh-80421: Correct definitions of time (#130984)
Based on the Wikipedia article, UTC is better said to be a successor than a renaming of GTC and language agnostic rather than an English-French compromise.
2025-03-09 16:09:23 -04:00
Barney Gale
475f933ed8
GH-130614: pathlib ABCs: revise test suite for path joining (#130988)
Test `pathlib.types._JoinablePath` in a dedicated test module. These tests
cover `LexicalPath`, `PurePath` and `Path`, where `LexicalPath` is defined
in a new `test.test_pathlib.support` package.
2025-03-09 17:02:37 +00:00
Barney Gale
bbd6d17ef8
GH-130614: pathlib ABCs: support alternate separator in full_match() (#130991)
In `pathlib.types._JoinablePath.full_match()`, treat alternate path
separators in the path and pattern as if they were primary separators. e.g.
if the parser is `ntpath`, then `P(r'foo/bar\baz').full_match(r'*\*/*')` is
true.
2025-03-09 16:36:59 +00:00