Commit graph

127083 commits

Author SHA1 Message Date
Bénédikt Tran
1b7470f8cb
gh-133061: do not mention UINT32_MAX in HMAC user-facing messages (#133062) 2025-04-28 01:14:12 +02:00
Yongzi Li
cd76eff26e
Docs: fix a couple typos in Doc/ (GH-132927)
fix minor typos
2025-04-27 15:56:58 -07:00
Bénédikt Tran
24436629ef
gh-127604: ensure -ldl is passed to the linker when dladdr1 is found (#133040) 2025-04-28 00:28:42 +02:00
Bénédikt Tran
3695ba93d5
gh-132993: expose HASHLIB_GIL_MINSIZE to private extension modules (#132999) 2025-04-27 22:20:15 +00:00
Michał Górny
019ee49d50
gh-133005: Support tarfile.open(mode="w|xz", preset=...) (GH-133007)
* gh-133005: Support `tarfile.open(mode="w|xz", preset=...)`

Support passing the `preset` option to `tarfile.open` when the file
is open with `mode="w|xz"`.  This aligns the behavior with `"w:xz"`
mode.

* Also raise an error for `compresslevel` or `preset` with wrong mode

Raise an error if `compresslevel` or `preset` argument is specified
for stream mode with incorrect compression. This should reduce the risk
of mistakes and align the stream modes with regular modes, that raise
an implicit TypeError on unsupported arguments.

* Apply suggestions from code review

Co-authored-by: Brian Schubert <brianm.schubert@gmail.com>
2025-04-27 22:19:59 +00:00
Lukas
146b981f76
Silence system utils tests in emscripten python.sh (#133044)
Ensure that checks for system functions don't leak onto stdout on failure.
2025-04-28 06:13:02 +08:00
Valters Jansons
6985e2e6de
gh-132026: Ensure _MIPS_SIM has defined _ABI identifiers for comparison (GH-132027)
When built on a MIPS architecture, `_MIPS_SIM` is used to determine
architecture specifics. The value is expected to match either
`_ABIO32`, `_ABIN32` or `_ABI64`.

In `gcc` config/mips/mips.h these values are defined as compiler
`builtin_define` inside of a switch/case. That means, mips64el and
mips64 architectures know about `_ABI64` but don't know about `_ABIO32`
and `_ABIN32`. In turn, when CPython tries to use them in comparison,
they may be undefined identifiers.

In default compiler behavior, the undefined identifier will be
evaluated as zero, and it will not match `_MIPS_SIM`. However, the
issues pop up when `-Wundef` (or, even worse, `-Werror=undef`) compiler
flag is enabled. Then suddenly it's visible as a warning or error.
2025-04-27 21:56:00 +00:00
Emma Smith
20be6ba61a
gh-132983: Introduce compression package and move _compression module (GH-133018)
* Introduces `compression` package for https://peps.python.org/pep-0784/

This commit introduces the `compression` package, specified in PEP 784
to re-export the `lzma`, `bz2`, `gzip`, and `zlib` modules. Introduction
of `compression.zstd` will be completed in a future commit once the
`_zstd` module is merged.

This commit also moves the `_compression` private module to
`compression._common._streams`.

* Re-exports existing module docstrings.
2025-04-27 14:41:30 -07:00
Hunter Hogan
6d53b75283
gh-133046: Reformat the `ast` module docstring (GH-133050)
* Fix formatting in module docstring for `ast` https://github.com/python/cpython/issues/133046
* #133046 ast docstring: remove header, dedent, 80-char width.
* Keep existing wrapping

---------

Co-authored-by: Adam Turner <9087854+aa-turner@users.noreply.github.com>
2025-04-27 14:35:56 -07:00
Mariusz Felisiak
28a2fd031e
gh-115032: Deprecate support for custom logging handlers with 'strm' argument. (GH-115314) 2025-04-27 22:18:14 +01:00
Gregory P. Smith
355ee1a429
[tests] fix test_fcntl issue when run in a ChromeOS linux runtime (GH-133053)
* [tests] test_fcntl fails when run in a ChromeOS linux runtime container.

It doesn't appear to support F_NOTIFY? Detect the lack of that and skip the test.
2025-04-27 13:28:23 -07:00
Sergey B Kirpichev
276252565c
gh-127495: Append to history file after every statement in PyREPL (GH-132294) 2025-04-27 15:32:37 +02:00
Nadeshiko Manju
614d79231d
gh-131798: JIT - Use sym_new_type instead of sym_new_not_null for _BUILD_STRING, _BUILD_SET (GH-132564)
Signed-off-by: Manjusaka <me@manjusaka.me>
2025-04-27 20:30:28 +08:00
Wulian233
8b4fd24ca5
gh-128438: Use EnvironmentVarGuard in test_zoneinfo.py (#131870) 2025-04-27 13:29:37 +02:00
Bénédikt Tran
cc05e4b867
gh-91069: do not disable sha3 in test_hashlib under UBSan (#133001) 2025-04-27 11:51:00 +02:00
Tian Gao
4f18916c5c
gh-124703: Set return code to 1 when aborting process from pdb (#133013) 2025-04-26 18:43:23 -04:00
Stan Ulbrych
ee033d4555
gh-63882: Implement some test_minidom tests (#132879)
Co-authored-by: Julian Gindi <julian@gindi.io>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-26 23:03:48 +03:00
John
8d6d7386a3
gh-133016: Fix a reference to removed asyncio.futures.TimeoutError (#133019)
Just use the builtin `TimeoutError`, and remove the import of `futures`.
2025-04-26 18:57:08 +00:00
Tomas R.
5e96e4fca8
gh-131798: JIT: Propagate the result in _BINARY_OP_SUBSCR_TUPLE_INT (GH-133003) 2025-04-27 02:47:55 +08:00
Stan Ulbrych
56c88e4e8d
gh-63882: Use self.assert* methods in test_minidom (#133000) 2025-04-26 18:24:54 +00:00
Tian Gao
0eb0e70ca0
gh-133006: Add subprocess check for remote pdb test (#133014) 2025-04-26 19:09:09 +01:00
Alyssa Ross
314f4b9716
gh-132991: Add socket.IP_FREEBIND constant (GH-132998) 2025-04-26 20:54:12 +03:00
Anthony Sottile
bd2e5f044c
gh-131298: update Modules/Setup after HACL* static linking changes (#133012)
This was overlooked in 5f2ba152a0.
2025-04-26 18:44:19 +02:00
Serhiy Storchaka
632524a5cb
gh-132987: Support __index__() for "k" and "K" formats in PyArg_Parse (GH-132988) 2025-04-26 17:14:18 +03:00
Bénédikt Tran
e714ead7a2
gh-132388: remove outdated TODO comment in test_hmac.py (#133008) 2025-04-26 13:17:03 +00:00
Bénédikt Tran
7f02ded29f
gh-91221: fix test_curses.test_use_default_colors for xterm-256color (#132990)
Terminals with `xterm-256color` Xterm support may use 15 (bright white) as their default foreground color.
2025-04-26 10:38:27 +00:00
Bénédikt Tran
ca12a744ab
gh-132781: fix refleaks in crossinterp_exceptions.h post gh-132782 (#132989) 2025-04-26 12:14:14 +02:00
Eric Snow
8a4d4f37ab
gh-132781: Make NotShareableError a TypeError Subclass (gh-132973)
It was a subclass of ValueError. However, shareability is a feature of types, not values.
2025-04-25 21:10:43 +00:00
Eric Snow
cd9536a087
gh-132781: Cleanup Code Related to NotShareableError (gh-132782)
The following are added to the internal C-API:

* _PyErr_FormatV()
* _PyErr_SetModuleNotFoundError()
* _PyXIData_GetNotShareableErrorType()
* _PyXIData_FormatNotShareableError()

We also drop _PyXIData_lookup_context_t and _PyXIData_GetLookupContext().
2025-04-25 14:43:38 -06:00
Diego Russo
4c20f46fa0
gh-131798: JIT: Narrow the return type of _CALL_LEN to int (#132940)
Reduce unnecessary guards whenever `len()` is called and used
after.

Co-authored-by: Max Bernstein <tekknolagi@gmail.com>
2025-04-26 02:57:42 +08:00
Victor Stinner
f0485de43a
gh-132950: Log is_remote_debug_enabled() in pythoninfo (#132965)
Log also the Py_REMOTE_DEBUG macro.
2025-04-25 18:13:47 +00:00
Pablo Galindo Salgado
a5e628beb8
gh-91048: Prevent optimizing away the asyncio debug offsets structure on Windows (#132963)
To avoid having the debug sections being optimised away by the compiler
we use  __attribute__((used)) on gcc and clang but in Windows this is
not supported by the Microsoft compiler and there is no equivalent flag.
Unfortunately Windows offers almost no alternative other than exporting
the symbol in the dynamic table or using it somehow.
2025-04-25 17:43:32 +00:00
Tian Gao
a1f4a6b246
gh-132912: Use readline to synchronize between procs in remote pdb test (#132949) 2025-04-25 18:40:18 +01:00
Victor Stinner
947c4f19d9
gh-132950: Skip test_remote_pdb if remote exec is disabled (#132951) 2025-04-25 17:28:25 +00:00
Eric Snow
2a28b21a51
gh-132776: Revert Moving memoryview XIData Code to memoryobject.c (gh-132960)
This is a partial revert of gh-132821.  It resolves the refleak introduced by that PR.
2025-04-25 16:43:50 +00:00
Pablo Galindo Salgado
622176513e
gh-132950: Check for Py_SUPPORTS_REMOTE_DEBUG in sys.is_remote_debug_enabled (#132959) 2025-04-25 16:38:48 +00:00
Victor Stinner
ac5424d6a9
gh-107954: Add audit event to PyConfig_Set() (#132958) 2025-04-25 18:30:39 +02:00
Victor Stinner
070d866567
gh-107954: Allow setting cpu_count in PyConfig_Set() (#132954)
* gh-107954: Allow setting cpu_count in PyConfig_Set()

* Update the doc
2025-04-25 18:29:55 +02:00
Victor Stinner
17718b0503
gh-91048: Fix _testexternalinspection.c on FreeBSD (#132945) 2025-04-25 14:57:01 +00:00
Victor Stinner
670b6cc096
gh-132912: Use SHORT_TIMEOUT in test_remote_pdb (#132939)
Replace hardcoded timeout of 5 seconds with SHORT_TIMEOUT.
2025-04-25 14:00:26 +00:00
Pablo Galindo Salgado
6cbeb6ab91
gh-132912: Account for race in test_keyboard_interrupt in test_remote_pdb (#132929) 2025-04-25 14:46:44 +01:00
Christian Veenhuis
52454c5d59
gh-132527: Added missing w typecode to array() error message (#132529)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-25 16:31:05 +03:00
Victor Stinner
eb2e430b88
gh-132912: Set 15 min timeout on GHA Hypothesis CI (#132914) 2025-04-25 13:29:16 +00:00
Pablo Galindo Salgado
e8cf3a1a64
gh-91048: Refactor _testexternalinspection and add Windows support (#132852) 2025-04-25 14:12:16 +01:00
Stan Ulbrych
f6fb498c97
gh-132798: Schedule removal of PyUnicode_AsDecoded/Encoded functions for 3.15 (#132799)
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-25 15:07:41 +02:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
8783cec9b6
gh-129027: Raise DeprecationWarning for sys._clear_type_cache (#129043)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-25 15:01:48 +03:00
Victor Stinner
b402a4889b
gh-132912: Skip flaky test in test_remote_pdb (#132924) 2025-04-25 11:46:43 +00:00
Ronald Oussoren
25e49841e3
gh-113539: Enable using `$BROWSER` to reorder default seach order in webbrowser.py (#113561)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-25 14:36:18 +03:00
Victor Stinner
1a70f66ea8
gh-132921: Fix setuptools._distutils.dep_util deprecation (#132923)
Replace setuptools._distutils.dep_util with setuptools.modified in
peg_generator compile_c_extension().
2025-04-25 11:31:19 +00:00
Victor Stinner
79ba56433e
gh-132912: Kill the process on error in test_remote_pdb (#132920)
If a test fails (such as an assertion error), kill the child process.
2025-04-25 13:14:59 +02:00