Commit graph

126221 commits

Author SHA1 Message Date
Thomas Grainger
2d83891dfd
gh-131649: fix test_string_literals SyntaxWarning (#131650) 2025-03-26 15:01:18 +01:00
Sam Gross
5abff6960b
gh-117657: Fix data race in compare_unicode_unicode_threadsafe (gh-131746)
We can't safely check the type of the found key until we incref it or if we know that it's immortal.
2025-03-26 09:01:57 -04:00
Ralf Gommers
ac12de2e6a
document that sys._is_gil_enabled is CPython-specific (#131748) 2025-03-26 17:32:52 +05:30
Jelle Zijlstra
898e6b395e
gh-130881: Handle conditionally defined annotations (#130935) 2025-03-26 03:48:19 +00:00
Donghee Na
7bb41aef4b
gh-131740: Update PyUnstable_GC_VisitObjects to traverse perm gen (gh-131744) 2025-03-26 09:45:29 +09:00
Bojun Ren
a26a301f8b
GH-130673: Gracefully handle missing sections in JIT build (GH-130906) 2025-03-25 16:35:39 -07:00
Chris Eibl
488174dc68
GH-131691: Fix exception handling setting for clang-cl on Windows (GH-131730)
The /EHa option for Clang-CL behaves differently than the same option for MSVC, which is why we don't use it for both compilers.
2025-03-25 23:07:52 +00:00
Peter Bierma
90b82f2b61
gh-129900: Fix SystemExit return codes when the REPL is started from the command line (#129901) 2025-03-25 19:48:46 +00:00
Thomas Grainger
8ada7a9e14
gh-131647: fix 'sys.path_hooks is empty' warning in test_importlib (#131648) 2025-03-25 18:16:15 +01:00
Diego Russo
ea0453ee97
GH-130887: Always remove trailing jumps in AArch64 JIT stencils (GH-131042) 2025-03-25 10:15:36 -07:00
Tomasz Pytel
0a91456ad1
gh-131719: add NULL pointer check to _PyMem_FreeDelayed (gh-131720) 2025-03-25 10:49:18 -04:00
Sergey Muraviov
44605aa93d
gh-131711: Preventing the use of a null pointer in set_tp_mro (#131713) 2025-03-25 14:28:38 +01:00
Kumar Aditya
f1967e7249
gh-127945: fix thread safety of ctypes state (#131710)
This fixes thread safety of `array_cache` and `swapped_suffix` by initializing them in module exec to make it thread safety.
2025-03-25 17:03:05 +05:30
Kumar Aditya
96ef4c511f
gh-127945: add locking to malloc closure in free-threading (#131662)
The freelist is not thread safe in free-threading so this adds lock around it make it thread safe in free-threading.
2025-03-25 16:48:46 +05:30
Thomas Grainger
6fb5f7f4d9
gh-131707: fix unawaited coroutine warning in test_coroutines.Corouti… (#131708)
gh-131707: fix unawaited coroutine warning in test_coroutines.CoroutineTest.test_17
2025-03-25 08:29:51 +00:00
Adam Turner
7d9442f0d5
gh-128446: Run Windows CI tests on each commit (#131702) 2025-03-25 09:06:15 +02:00
Bénédikt Tran
1393bd3548
gh-131666: mark anext_awaitable.close as a METH_NOARGS instead of METH_VARARGS (#131671) 2025-03-25 09:03:22 +05:30
Chris Eibl
c3b8d73208
GH-131473: Override PreferredToolArchitecture when using Visual Studio bundled clang-cl (GH-131689)
tweak PreferredToolArchitecture for bundled clang-cl
2025-03-24 23:15:51 +00:00
Hood Chatham
97ab8fc16a
gh-127146: Fix Emscripten build with --pydebug (#131672)
Removes an explicit check that sysconfigdata naming is correct, in favor of reporting at
runtime with the default mechanisms.
2025-03-25 05:43:31 +08:00
Sam Gross
a123245986
gh-131677: Fix flaky test_lru_cache_threaded3 (gh-131679)
The call to `with self.subTest(...)` was not thread-safe.
2025-03-24 16:41:50 -04:00
Ageev Maxim
7c3692fe27
gh-130928: Fix error message during bytes formatting for the 'i' flag (#130967) 2025-03-24 22:07:03 +03:00
sobolevn
929afd1d6e
gh-131670: Fix crash in anext() when __anext__ is sync and raises (#131682)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-24 19:00:48 +00:00
Victor Stinner
5fef4ff9ed
gh-111178: Fix function signature in pyexpat.c (#131674)
Move _Py_NO_SANITIZE_UNDEFINED macro from faulthandler.c to pyport.h.
2025-03-24 17:22:45 +00:00
Chris Eibl
d16f455cd8
GH-131521: Uses correct build flags for zlib-ng on Windows (GH-131526)
Do not enable AdvancedVectorExtensions2 for all *.c files, so that the resulting binary can be executed on older CPUs, too. Also enable AdvancedVectorExtensions512 where necessary, and add the ClangCL flags required to enable vector extensions.
2025-03-24 16:21:57 +00:00
Bénédikt Tran
1d6a2e6481
gh-111178: fix UBSan for example code in extending/newtypes_tutorial docs (GH-131606)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-03-24 17:15:32 +01:00
Barney Gale
d372472896
GH-128520: pathlib ABCs: tighten up argument types (#131621)
In `JoinablePath.full_match()` and `ReadablePath.glob()`, accept a `str`
pattern argument rather than `JoinablePath | str`.

In `ReadablePath.copy()` and `copy_into()`, accept a `WritablePath` target
argument rather than `WritablePath | str`.
2025-03-24 15:39:08 +00:00
David Lowry-Duda
d2d886215c
gh-115684: Clarify datetime replace documentation (#116519)
* Clarify datetime `replace` documentation

In #115684, HopedForLuck noted that `datetime.date.replace()`
documentation was confusing because it looked like it would be changing
immutable objects.

This documentation change specifies that the `replace()` methods in
`datetime` return new objects. This uses similar wording to the
documentation for `datetime.combine()`, which specifies that a new
datetime is returned. This is also similar to wording for
`string.replace()`, except `string.replace()` emphasizes that a "copy"
is returned.

Resolves #115684.

* Include reviewer comments

Thanks Privat33r-dev for the comments!

---------

Co-authored-by: Paul Ganssle <1377457+pganssle@users.noreply.github.com>
2025-03-24 11:33:16 -04:00
Barney Gale
d716ea34cb
GH-128520: pathlib ABCs: validate magic_open() arguments (#131617)
When `pathlib._os.magic_open()` is called to open a path in binary mode,
raise `ValueError` if any of the *encoding*, *errors* or *newline*
arguments are given. This matches the `open()` built-in.
2025-03-24 15:13:18 +00:00
Barney Gale
fbfb0e1f6e
GH-128520: pathlib ABCs: reject empty pattern in ReadablePath.glob() (#127343)
For compatibility with `Path.glob()`, raise `ValueError` if an empty
pattern is given to `ReadablePath.glob()`.
2025-03-24 15:12:29 +00:00
Chris Eibl
a04c0a9658
GH-131296: Remove unused variable from _wmimodule.cpp (GH-131587) 2025-03-24 14:57:07 +00:00
Victor Stinner
69e94e0a1b
gh-111178: Fix function signatures for test_socket (#131667)
Add unicode_fsdecode() wrapper for PyUnicode_DecodeFSDefault() to use
the correct API for Py_BuildValue() converter API.
2025-03-24 14:51:32 +00:00
Bénédikt Tran
4efe397d8e
gh-111178: fix UBSan failures for anextawaitableobject (#131609) 2025-03-24 14:43:48 +00:00
Victor Stinner
b3319fe42f
gh-111178: Skip tests which require deep stack if UBsan (#131669)
If Python is built with Undefined Behavior sanitizer, skip
test_repr_deep() of test_userdict and test_lru_recursion() of
test_functools.
2025-03-24 15:33:56 +01:00
Victor Stinner
6226edc48b
gh-111178: Fix function signatures for test_capi (#131659)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-24 14:04:45 +00:00
Victor Stinner
78f1bac7f2
gh-111178: Fix function signature for test_threading (#131663) 2025-03-24 13:56:45 +00:00
Sam Gross
da6730caa5
gh-128421: Avoid TSAN warnings in sys._current_frames() (gh-131548)
This tells TSAN not to sanitize `PyUnstable_InterpreterFrame_GetLine()`.
There's a possible data race on the access to the frame's `instr_ptr`
if the frame is currently executing. We don't really care about the
race. In theory, we could use relaxed atomics for every access to
`instr_ptr`, but that would create more code churn and current compilers
are overly conservative with optimizations around relaxed atomic
accesses.

We also don't sanitize `_PyFrame_IsIncomplete()` because it accesses
`instr_ptr` and is called from assertions within PyFrame_GetCode().
2025-03-24 09:49:39 -04:00
Victor Stinner
4596666a9f
gh-111178: Fix function signatures for test_zoneinfo (#131664) 2025-03-24 14:32:46 +01:00
Victor Stinner
abcd9d4f7d
gh-111178: Fix function signatures for test_ctypes (#131660) 2025-03-24 14:30:13 +01:00
Petr Viktorin
0e53038ea8
gh-128715: Expose ctypes.CField, with info attributes (GH-128950)
- Restore max field size to sys.maxsize, as in Python 3.13 & below
- PyCField: Split out bit/byte sizes/offsets.
- Expose CField's size/offset data to Python code
- Add generic checks for all the test structs/unions, using the newly exposed attrs
2025-03-24 14:18:34 +01:00
Sergey Miryanov
62fb15d866
gh-131311: Extract _replace_array_elements from PyCStructUnionType_update_stginfo (GH-131504) 2025-03-24 13:55:09 +01:00
Kumar Aditya
04d4aacaac
gh-128485: ensure that dlmalloc initializes itself at import time in ctypes (#131633) 2025-03-24 18:14:25 +05:30
Sergey Miryanov
9c4fb92e12
gh-131311: Fix additional memory leaks in ctypes (GH-131429)
* Visit keep in StructParam_traverse
* Decref swapped in PyCSimpleType_init
* Decref ob in make_funcptrtype_dict
* Check Pointer_item result while constructing result list in Pointer_subscript

* Fix align and size naming in PyCStructUnionType_update_stginfo
  - as discussed in previous PR
2025-03-24 13:42:10 +01:00
Thomas Grainger
71ce4acb25
gh-131645: fix ResourceWarnings in test_asyncio.test_events (#131646) 2025-03-24 12:38:33 +00:00
Petr Viktorin
01ea4c77e5
gh-123909: Remove obsolete note in PyType_FromMetaclass docs (GH-131506)
Docs of the other `PyType_From*` functions link to `PyType_FromMetaclass`,
which noted that they differ for backwards compatibility reasons.
The note is no longer relevant in 3.14.
The other functions have `versionchanged` blurbs.
2025-03-24 13:06:21 +01:00
Bénédikt Tran
af29d5cfd1
gh-111178: fix UBSan failures for Modules/_testcapimodule.c (#131614)
Fix UBSan failures for various classes in `Modules/_testcapimodule.c`,
remove some redundant casts and add some `Py_UNUSED()` usages.
2025-03-24 10:14:22 +00:00
Bénédikt Tran
491b8141f5
gh-111178: fix UBSan failures for Modules/_testcapi/{buffer,monitoring}.c (#131613) 2025-03-24 11:06:37 +01:00
Bénédikt Tran
a1205ef524
gh-111178: fix UBSan failures for PyBytesObject (#131603) 2025-03-24 11:02:09 +01:00
Bénédikt Tran
511a844028
gh-111178: fix UBSan failures for Python/legacy_tracing.c (#131611) 2025-03-24 11:00:32 +01:00
Bénédikt Tran
45191797d8
gh-111178: fix UBSan failures for Modules/_testmultiphase.c (#131615) 2025-03-24 10:59:30 +01:00
Bénédikt Tran
43fde78bef
gh-111178: fix UBSan failures for Python/instrumentation.c (#131608) 2025-03-24 10:58:33 +01:00