Commit graph

126071 commits

Author SHA1 Message Date
Bénédikt Tran
27f81e82df
gh-111178: fix UBSan failures for PyStdPrinter_Object (#131607) 2025-03-24 10:57:14 +01:00
Bénédikt Tran
f65be097ed
gh-111178: fix UBSan failures for _PyExecutorObject (#131610) 2025-03-24 10:53:23 +01:00
Bénédikt Tran
aa444bc4af
gh-111178: fix UBSan failures for PyBufferWrapper (#131616) 2025-03-24 10:52:52 +01:00
Bénédikt Tran
82e541bf91
gh-111178: fix UBSan failures for Modules/_testbuffer.c (#131612) 2025-03-24 10:46:25 +01:00
Bénédikt Tran
ef06508f8e
gh-111178: fix UBSan failures for TaskStepMethWrapper (#131602) 2025-03-23 19:56:03 +05:30
Zsolt Dollenstein
5fc889ffbf
no-issue: Fix typo in importlib.metadata.rst (gh-131596) 2025-03-23 23:01:29 +09:00
Irit Katriel
64906bb223
gh-130080: do not fold match case constants in unoptimized AST (#131577) 2025-03-23 13:50:14 +00:00
Kanishk Pachauri
fd459b1153
gh-130283: update deprecated links and examples in urllib.request docs (#130284)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-23 13:29:29 +00:00
Sebb
557d2d20d4
gh-121529: Document from_ parameter in _mboxMMDF public methods (#121530) 2025-03-23 13:10:47 +01:00
Bénédikt Tran
a9a399f0ec
gh-131418: remove unused legacy typedefs in {md5,sha1}module.c (#131420)
- Remove legacy typedefs `MD5_INT32` and `MD5_INT64` in `Modules/md5module.c`
- Remove legacy typedefs `SHA1_INT32` and `SHA1_INT64` in `Modules/sha1module.c`.

Those legacy typedefs were used to detect whether the host platform could
correctly implement MD5 and SHA-1, but this is no longer needed as we now
fallback to HACL* implementations.
2025-03-23 12:19:26 +01:00
Nybblista
f3bf304c27
gh-131357: Add a set of asserts to test.test_capi.test_bytearray (#131554)
add a set of asserts to test.test_capi.test_bytearray

1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
2025-03-23 10:20:40 +03:00
Chris Eibl
bc26f95e8f
GH-131296: fix clang-cl warning on Windows in semaphore.c (GH-131595)
fix clangcl warning
2025-03-22 15:44:56 -07:00
Sam Gross
18249d9383
gh-131566: Skip test_tracemalloc_track_race under TSAN (gh-131567)
The test has data race when setting the global "raw" memory allocator.
2025-03-22 11:46:36 -04:00
Victor Stinner
9962469943
gh-131296: fix clang-cl warning in tracemalloc.c (#131514)
Always set MAX_NFRAME to UINT16_MAX.

Avoid the complicated code which emitted a compiler warning.
2025-03-22 10:38:47 +01:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
8b7d20d3a9
gh-131457: Fix typo in BNF description of function signatures (#131460) 2025-03-22 10:54:48 +03:00
Victor Stinner
49fb75c676
gh-131238: Add missing pycore_function.h includes for JIT compiler (#131571) 2025-03-21 23:37:49 +00:00
Dino Viehland
d9411ae3c2
gh-130312: SET_ADD should not lock (#130136)
SET_ADD should not lock
2025-03-21 15:58:32 -07:00
Victor Stinner
7101cba6bf
gh-131238: Move _Py_VISIT_STACKREF() to pycore_stackref.h (#131560)
* Move _Py_VISIT_STACKREF() from pycore_gc.h to pycore_stackref.h.
* Remove pycore_interpframe.h include from pycore_genobject.h.
* Remove now useless includes from C files.
* Add pycore_interpframe_structs.h to Makefile.pre.in and
  pythoncore.vcxproj.
2025-03-21 23:24:14 +01:00
Barney Gale
cf9d1a4b6b
GH-128520: pathlib ABCs: allow tests to be run externally (#131315)
Adjust the tests for the `pathlib.types` module so that they can be run
against the `pathlib-abc` PyPI package, which is a backport of the module
for older Python versions.

Specifically, we add a `.support.is_pypi` switch that is false in the
stdlib and true in the pathlib-abc package. This controls which package
we import, and whether or not we run tests against `PurePath` and `Path`.

For compatibility with older Python versions, we stop using
`zipfile.ZipFile.mkdir()` and `zipfile.ZipInfo._for_archive()`.
2025-03-21 22:18:20 +00:00
Sam Gross
56d0f9af14
gh-117657: Skip some tests when running with TSAN (gh-131555)
The subinterpreter tests have data races (see gh-129824).

TSAN attempts to intercept some of the fatal signals, which can lead to
bogus reports. We could possibly handle these via TSAN_OPTIONS, but it's
simpler to just skip those tests -- they're not multithreaded anyways.
2025-03-21 15:16:08 -04:00
Savannah Ostrowski
b92ee14b80
GH-130415: Optimize constant comparison in JIT builds (GH-131489) 2025-03-21 11:23:12 -07:00
Sam Gross
0de5e0c544
gh-117657: Fix TSAN data race in _PyEval_SetTrace assertion (gh-131561)
The `sys_tracing_threads` variable should be read inside `LOCK_SETUP()`.
2025-03-21 14:22:37 -04:00
Irit Katriel
3e2cceaa87
gh-131233: remove return-in-finally in multiprocessing/connection.py (#131416) 2025-03-21 18:05:47 +00:00
Łukasz Langa
4cc82ffa37
gh-131507: Refactor screen and cursor position calculations (GH-131547)
This is based off #131509.
2025-03-21 18:27:35 +01:00
Victor Stinner
61317074d4
gh-131238: Add pycore_interpframe_structs.h header (#131553)
Add an explicit include to pycore_interpframe_structs.h in
pycore_runtime_structs.h to fix a dependency cycle.
2025-03-21 17:19:47 +00:00
Victor Stinner
1a082085ae
gh-131238: Remove pycore_object_deferred.h from pycore_object.h (#131549)
Remove also pycore_function.h from pycore_typeobject.h.
2025-03-21 16:44:10 +00:00
Victor Stinner
3a09986553
gh-131238: Add pycore_interpframe.h to PYTHON_HEADERS (#131545)
Add pycore_interpframe.h to Makefile.pre.in and pythoncore.vcxproj.
2025-03-21 16:24:15 +01:00
Sam Gross
4f32516804
gh-128421: Add locking to most frame object functions (gh-131479)
This makes more operations on frame objects thread-safe in the free
threaded build, which fixes some data races that occurred when passing
exceptions between threads.

However, accessing local variables from another thread while its running
is still not thread-safe and may crash the interpreter.
2025-03-21 11:10:07 -04:00
Łukasz Langa
5d8e981c84
gh-131507: Clean up tests and type checking for _pyrepl (#131509) 2025-03-21 15:48:10 +01:00
Mark Shannon
d3f6063af1
GH-131513: Cases generator: Allow dead inputs to be reassigned (GH-131515) 2025-03-21 11:38:17 +00:00
Xavier G.
b70d45ab22
gh-131268: Implement thread names on OpenBSD (#131528) 2025-03-21 11:12:35 +01:00
Stan Ulbrych
e0fda794fa
gh-70647: Raise a more informative error for when date is out of range (GH-131335)
More informative error messages mean less debugging what went wrong.
2025-03-20 20:47:09 -07:00
Tian Gao
e3564689a5
gh-120144: Disable the CALL event when possible to achieve zero overhead pdb (#131390) 2025-03-20 20:31:55 -04:00
Bénédikt Tran
883c2f682b
GH-131331: Rename "not" to "invert" (GH-131334) 2025-03-20 16:59:41 -07:00
Sam Gross
844765b20f
gh-131269: Minor optimization in random.py (#131270) 2025-03-20 17:10:33 -05:00
dgpb
c83efa7a66
gh-131435: random.randint optimization (gh-131436) 2025-03-20 17:07:28 -05:00
Thomas Grainger
ce79274e9f
gh-131492, gh-131461: handle exceptions in GzipFile constructor while owning resources (#131462)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-20 17:06:21 +00:00
luccabb
f53e7de6a8
gh-88887: Cleanup multiprocessing.resource_tracker.ResourceTracker upon deletion (#130429)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-03-20 17:44:37 +01:00
AN Long
00a9844888
gh-131453: Add additional constants to winsound module (GH-131454) 2025-03-20 16:35:52 +00:00
Chris Eibl
a2ea417578
GH-131296: fix clang-cl warnings in sysmodule.c (#131304) 2025-03-20 16:29:21 +00:00
Irit Katriel
749e24b48f
gh-130080: fix warnings in tests (#131471) 2025-03-20 16:11:04 +00:00
Mark Shannon
684a759c20
GH-127705: Don't call _Py_ForgetReference before _Py_Dealloc (GH-131508) 2025-03-20 15:45:43 +00:00
Mark Shannon
7ebd71ee14
GH-131498: Remove conditional stack effects (GH-131499)
* Adds some missing #includes
2025-03-20 15:39:38 +00:00
Adam Turner
443c0cd17c
gh-127833: Use productionlist nodes to implement the grammar-snippet directive (#130376)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Blaise Pabon <blaise@gmail.com>
2025-03-20 15:35:20 +00:00
Peter Bierma
86d5fa95cf
gh-127989: C API: Refer to "attached thread states" instead of the GIL (GH-127990)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-03-20 13:06:59 +01:00
Mark Shannon
83d54fa876
GH-130296: Remove _PyOpcode_max_stack_effect as it is no longer used (GH-131493) 2025-03-20 11:42:54 +00:00
Victor Stinner
b69da006a4
gh-131238: Remove includes from pycore_interp.h (#131495)
Remove also now unused includes in C files.
2025-03-20 11:35:23 +00:00
Victor Stinner
34c1ea3109
gh-111178: Fix function signatures for multiple tests (#131496) 2025-03-20 12:27:03 +01:00
Victor Stinner
486d537065
Fix Windows build warnings (#131487)
Fix the following warnings:

* Modules\_io\fileio.c(1296,13): unused variable 'self'
* Modules\_io\winconsoleio.c(334,9): unused variable 'fd_is_own'
* Modules\faulthandler.c(409,11): unused variable 'flags'
* Modules\posixmodule.c(5699,9): unused variable 'pathError'
* PC\winreg.c(2077,5): suggest braces around initialization of
  subobject
* PC\winreg.c(34,13): unused variable 'errNotAHandle'
* Python\fileutils.c(132,12): result of comparison of constant
  1114111 with expression of type 'wchar_t' (aka 'unsigned short') is
  always false
* Python\fileutils.c(58,21): unused variable 'INCOMPLETE_CHARACTER'
* Python\sysmodule.c(2534,21): unused variable 'perf_map_state'
2025-03-20 12:03:20 +01:00
Nybblista
2433cc79d7
gh-131441: Add a set of asserts to test.test_capi.test_list (#131442) 2025-03-20 10:12:15 +00:00