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
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
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
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
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
Mark Shannon
7ebd71ee14
GH-131498: Remove conditional stack effects (GH-131499)
...
* Adds some missing #includes
2025-03-20 15:39:38 +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
Victor Stinner
20c5f969dd
gh-131238: Remove more includes from pycore_interp.h ( #131480 )
2025-03-19 23:01:32 +01:00
Steve Dower
63a638c43f
gh-91349: Replace zlib with zlib-ng in Windows build (GH-131438)
2025-03-19 19:03:25 +00:00
Victor Stinner
5c44d7d99c
gh-130931: Add pycore_interpframe.h internal header ( #131249 )
...
Move _PyInterpreterFrame and associated functions
to a new pycore_interpframe.h header.
2025-03-19 18:17:44 +01:00
Victor Stinner
4b54031323
gh-131238: Remove pycore_runtime.h from pycore_pystate.h ( #131356 )
...
* Remove includes from pycore_pystate.h:
* pycore_runtime_structs.h
* pycore_runtime.h
* pycore_tstate.h
* pycore_interp.h
* Reorganize internal headers. Move _gc_thread_state from
pycore_interp_structs.h to pycore_tstate.h.
* Add 3 new header files to PCbuild/pythoncore.vcxproj.
2025-03-19 17:33:24 +01:00
Victor Stinner
6935d96e9c
gh-111178: Fix function signatures in _testbuffer.c ( #131463 )
2025-03-19 16:54:18 +01:00
Victor Stinner
f5e4c2955b
gh-111178: Fix function signatures for test_iter ( #131456 )
2025-03-19 14:42:51 +01:00
Max Bachmann
49234c065c
gh-114917: Fix typo in getaddrinfo emulation ( #131413 )
2025-03-18 14:31:13 +01:00
Petr Viktorin
51d309988b
gh-131261: expat/refresh.sh: Expand list of manual steps (GH-131359)
2025-03-18 13:17:43 +01:00
Sergey Miryanov
812074e291
gh-131311: Consolidate reference handling in PyCStructUnionType_update_stginfo to fix memory leak (GH-131312)
2025-03-18 11:50:22 +01:00
Max Bachmann
3453b5c1d6
gh-114917: add support for AI_NUMERICSERV in getaddrinfo emulation ( #114918 )
2025-03-18 11:26:51 +01:00
Tomasz Pytel
863d54cbaf
gh-126895: Fix readline module in free-threaded build ( #131208 )
...
The underlying readline library is not thread-safe so this adds `@critical_section` to functions that use it.
2025-03-17 11:57:11 -04:00
Bénédikt Tran
e708ac8dd4
gh-111178: fix UBSan failures in Modules/_ssl.c (GH-130719)
...
* fix UBSan failures for `PySSLContext`, `PySSLSocket`, `PySSLMemoryBIO`, `PySSLSession`
2025-03-17 16:25:28 +01:00
Mark Shannon
a45f25361d
GH-131238: More refactoring of core header files (GH-131351)
...
Adds new pycore_stats.h header file to help break dependencies involving the pycore_code.h header.
2025-03-17 14:41:05 +00:00
Gregory P. Smith
bb0268f60d
gh-131261: Update libexpat to 2.7.0 (CVE-2024-8176) ( #131272 )
2025-03-17 14:55:02 +01:00
Victor Stinner
978e37bb5f
gh-131238: Add explicit includes to pycore headers ( #131257 )
2025-03-17 12:32:43 +01:00
Bénédikt Tran
ac50ece6ce
gh-127667: refactor and improve _hashopenssl.c error branches ( #131145 )
...
Refactor `_setException()` into different helpers that can be used separately:
- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.
2025-03-17 11:12:55 +01:00
Bénédikt Tran
261633bd3f
gh-131316: handle NULL values returned by HACL* functions ( #131324 )
...
- Handle NULL returned by allocation functions.
- Handle NULL returned by copy functions.
- Suppress unused impossible return codes.
2025-03-17 11:10:39 +01:00
Mark Shannon
a1aeec61c4
GH-131238: Core header refactor (GH-131250)
...
* Moves most structs in pycore_ header files into pycore_structs.h and pycore_runtime_structs.h
* Removes many cross-header dependencies
2025-03-17 09:19:04 +00:00
Chris Eibl
faa80fcf46
GH-131296: fix clang-cl warnings on Windows in blake2module.c ( #131299 )
...
work around unimportant clang-cl warnings in blake2module.c
2025-03-15 11:37:53 -07:00
Chris Eibl
0ce056d265
gh-130213: update hacl_star_rev to 322f6d58290e0ed7f4ecb84fcce12917aa0f594b (GH-130960)
...
Updates the HACL* implementation used by hashlib from upstream sources.
2025-03-15 10:42:27 -07:00
Victor Stinner
db62557e3d
gh-111178: Fix function signatures for test_os ( #131227 )
2025-03-14 13:53:06 +00:00
Victor Stinner
ca7fd814e4
gh-111178: Fix function signatures in _asynciomodule.c ( #131228 )
2025-03-14 13:37:39 +00:00
Victor Stinner
a5776639c8
gh-111178: Fix function signatures to fix undefined behavior ( #131191 )
2025-03-14 09:52:15 +00:00
Tomasz Pytel
c5abded099
gh-130382: add missing _PyReftracerTrack to ceval Py_DECREF ( #130689 )
2025-03-13 12:31:49 -04:00
Victor Stinner
9a63138e09
gh-111178: Fix function signatures in misc files ( #131180 )
2025-03-13 16:55:08 +01:00
Victor Stinner
10cbd1fe88
gh-130947: Add again PySequence_Fast() to the limited C API ( #130948 )
...
Add again PySequence_Fast() to the limited C API.
Add unit tests.
2025-03-13 13:00:57 +01:00
Furkan Onder
e98d321bef
gh-130099: Fix CAN socket fallthrough annotation for NetBSD compatibility ( #131026 )
2025-03-13 11:25:43 +01:00
Max Bachmann
f7ac656c8e
Remove vestigial code in socketmodule.c for Mac OS X 10.1 ( #131090 )
2025-03-13 00:13:07 -04:00
Victor Stinner
061da44bac
gh-111178: Change Argument Clinic signature for @classmethod ( #131157 )
...
Use "PyObject*", instead of "PyTypeObject*", for `@classmethod`
functions to fix an undefined behavior.
2025-03-12 17:42:07 +01:00
Pieter Eendebak
405a2d74cb
gh-123471: make itertools.batched thread-safe ( #129416 )
2025-03-12 15:30:33 +05:30
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
Max Bachmann
44c55c2356
Replace K&R function declarations with ANSI declarations ( #114818 )
2025-03-11 13:06:36 +01: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
morotti
b1b4f9625c
gh-117151: IO performance improvement, increase io.DEFAULT_BUFFER_SIZE to 128k (GH-118144)
...
Co-authored-by: rmorotti <romain.morotti@man.com>
2025-03-07 11:36:12 -08:00
Cody Maloney
886a4d74ee
gh-129011: Update comments in FileIO to match current code ( #129012 )
2025-03-06 17:18:22 -08:00
Sam Gross
052cb717f5
gh-124878: Fix race conditions during interpreter finalization ( #130649 )
...
The PyThreadState field gains a reference count field to avoid
issues with PyThreadState being a dangling pointer to freed memory.
The refcount starts with a value of two: one reference is owned by the
interpreter's linked list of thread states and one reference is owned by
the OS thread. The reference count is decremented when the thread state
is removed from the interpreter's linked list and before the OS thread
calls `PyThread_hang_thread()`. The thread that decrements it to zero
frees the `PyThreadState` memory.
The `holds_gil` field is moved out of the `_status` bit field, to avoid
a data race where on thread calls `PyThreadState_Clear()`, modifying the
`_status` bit field while the OS thread reads `holds_gil` when
attempting to acquire the GIL.
The `PyThreadState.state` field now has `_Py_THREAD_SHUTTING_DOWN` as a
possible value. This corresponds to the `_PyThreadState_MustExit()`
check. This avoids race conditions in the free threading build when
checking `_PyThreadState_MustExit()`.
2025-03-06 10:38:34 -05:00
Serhiy Storchaka
63d25f8d0c
gh-130824: Clean up test wrappers for PyLong_*AndOverflow functions (GH-130871)
2025-03-05 11:50:53 +01:00
Peter Bierma
90130807d9
gh-130824: Add tests for NULL in PyLong_*AndOverflow functions (GH-130828)
...
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2025-03-05 09:58:39 +01:00
Jelle Zijlstra
dc6d66f44c
gh-105499: Merge typing.Union and types.UnionType ( #105511 )
...
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2025-03-04 11:44:19 -08:00