Commit graph

131344 commits

Author SHA1 Message Date
Guo Ci
2d3dec0fbd
gh-140924: In locale module, add missing names to __all__ (GH-140925) 2026-05-11 17:21:03 +03:00
Jelle Zijlstra
56171da341
gh-144957: Fix lazy imports + module __getattr__ (GH-149624) 2026-05-11 15:08:12 +02:00
Sergey B Kirpichev
ef877318a0
gh-149402: Don't assume single-character type codes (struct/array/ctypes) (#149483)
In the struct docs, section "Format Characters" was renamed to "Type
Codes".

Co-authored-by: Victor Stinner <vstinner@python.org>
2026-05-11 13:05:50 +00:00
Árni Már Jónsson
4956d2be9d
gh-149663: fix typo in unittest docs (#149670)
`hastattr` -> `hasattr`
2026-05-11 14:54:09 +03:00
Jonathan Dung
833dae7c1f
gh-146061: Clarify indent=None in json docs (GH-146095) 2026-05-11 11:14:54 +00:00
sobolevn
0108843451
gh-149634: Remove deprecated and unused tarfile.Tarfile.tarfile attr (GH-149635) 2026-05-11 12:54:49 +02:00
pengyu lee
53c3dd9a8d
Fix typos in C API documentation (GH-149588) 2026-05-11 10:28:19 +02:00
Michael Droettboom
f23a1837d7
gh-112821: Fix rlcompleter failures on objects with descriptors (#149577)
* gh-112821: Fix rlcompleter failures on objects with descriptors

* Confirm no accesses
2026-05-10 21:44:59 -04:00
Barry Warsaw
197878529f
gh-75723: Fix double evaluation of .pth and .site files in venvs (#149583)
* Idempotent `.pth` execution in `site.addsitedir`
* potentially fix monkeypatch leak?

* fix blind copy paste of recommendation

* Update 2026-03-31-16-15-15.gh-issue-75723.BZ4Rsn.rst

* fix implicit merge conflict with 24c4aecc16

* Add failing tests for gh-75723

Based on @asottle branch !asottle-gh-75723 but refactored for `main`.
This will need a different backport.

* Repair gh-75723

The original fix is here: https://github.com/python/cpython/pull/147951
but I'm refactoring a bit for `main`.

* Refactor _make_mod() so we can use it to create package modules too

* Add myself to CODEOWNERS for the site module

---------

Co-authored-by: anthony sottile <asottile@umich.edu>
Co-authored-by: Filipe Laíns <lains@riseup.net>
2026-05-10 17:25:39 -07:00
sobolevn
c1dbd51fac
gh-149598: Remove strm argument support from logging handlers (#149599)
gh-149598: Remove *strm* argument support from `logging` handlers
2026-05-11 03:05:56 +03:00
Sergey B Kirpichev
c6fd7de64a
gh-149083: use sentinel to fix _functools.reduce() signature (#149591) 2026-05-10 15:22:16 -07:00
Jelle Zijlstra
b45319e132
gh-139489: Add is_valid_text to xml.__all__ (#149641) 2026-05-10 13:43:57 -07:00
Omkar Kabde
a8e3247206
gh-149611: Explain return values for Path.write_text() and Path.write_bytes() (#149629)
specify return explanation

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2026-05-10 17:41:37 +00:00
Stan Ulbrych
24b8f12544
gh-149018: Use XML_SetHashSalt16Bytes in pyexpat/_elementtree when possible (#149023) 2026-05-10 18:36:26 +01:00
ByteFlow
bc1be4f617
gh-148441: Avoid integer overflow in Expat's CharacterDataHandler (#148904)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2026-05-10 15:42:04 +02:00
Pieter Eendebak
a2c1657cab
gh-149436: Speed up inspect.getattr_static for the common-metaclass case (#149437)
Consecutive MRO entries usually share their metaclass, so call
_shadowed_dict at most once per distinct metaclass.
2026-05-09 19:52:52 -07:00
Cody Maloney
cc5cf14ae0
gh-139871: Fix 3.15 bytearray.take_bytes example (#149520)
Currently:
```python
buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = bytes(buffer[:n + 1])
del buffer[:n + 1]
assert data == b'abc'
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
    assert data == b'abc'
           ^^^^^^^^^^^^^^
AssertionError
```

Adding in the `\n` makes the two match:

```python
buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = bytes(buffer[:n + 1])
del buffer[:n + 1]
assert data == b'abc\n'
assert buffer == bytearray(b'def')

buffer = bytearray(b'abc\ndef')
n = buffer.find(b'\n')
data = buffer.take_bytes(n + 1)
assert data == b'abc\n'
assert buffer == bytearray(b'def')
```
2026-05-09 14:39:01 -07:00
Manoj K M
4e97ff3351
Fix minor typos in unicode.rst (#149587) 2026-05-09 21:31:55 +00:00
Max Schmitt
7241f2739c
gh-149388: Make asyncio PipeHandle.close idempotent (#149518) 2026-05-09 19:44:29 +05:30
László Kiss Kollár
9587726a3e
gh-149430: Fix edge-cases in profiling.sampling outputs (#149431)
The line highlights on the heatmap are driven by the URL hash and the
`:target` selector. When clicking a caller/callee link for the line that
was already selected, the hash doesn't change, so the browser keeps the
existing target state and doesn't restart the animation. Due to this the
highlight only works the first time.

With this fix, line navigation goes through JavaScript. If the target
URL already points to the current location, the highlight is replayed by
clearing the animation, forcing style recalculation, and restoring it.

The `baseline_self` variable isn't initialized for structural elided
roots. This variable is accessed later unconditionally and leads to a
crash.

The child process ends up being invoked with `--diff_flamegraph` instead
of the correct argument.
2026-05-09 14:05:46 +01:00
sobolevn
46a2c11eaa
gh-149530: Remove symtable.Class.get_methods deprecated method (#149531) 2026-05-09 08:33:09 +00:00
sobolevn
bc8cf07d8d
gh-149083: Convert _initial_missing for pure py reduce to sentinel (#149536) 2026-05-09 10:55:09 +03:00
Maurycy Pawłowski-Wieroński
354ef336e4
gh-149474: use Py_fopen in Binary{Reader,Writer} for audit hook and path-like support (#149524) 2026-05-09 01:01:35 +01:00
Jeff Lyon
45c47d26c2
gh-149496: Fix MacOSTest.test_default regression when BROWSER env var is set (GH-149579)
gh-149496: Fix MacOSTest.test_default failing when BROWSER env var is set

MacOSTest.test_default calls webbrowser.get() and asserts it returns a
MacOS instance. When BROWSER is set in the environment (e.g. BROWSER=open,
a common macOS workaround for the old osascript-based implementation),
register_standard_browsers() registers a GenericBrowser as the preferred
browser instead, causing the assertion to fail.

This is a regression introduced in gh-137586, which added MacOSTest and
moved test_default into it from MacOSXOSAScriptTest. MacOSXOSAScriptTest
had an identical setUp() guard added in gh-131254 specifically to fix this
same failure. The guard was not carried over to MacOSTest.

Add setUp() to MacOSTest to unset BROWSER for the duration of each test,
restoring the isolation that was already established as the correct pattern
for macOS webbrowser tests.
2026-05-08 20:33:05 +00:00
Serhiy Storchaka
57ef219950
gh-79638: Test other HTTP error codes besides 403 in test_robotparser (#149569)
Also, use urllib.request.urlcleanup() in NetworkTestCase.
2026-05-08 20:24:34 +00:00
sobolevn
3a62c8f13a
gh-149537: Remove kw parameters from python version of reduce (#149538) 2026-05-08 18:34:48 +03:00
Diego Russo
ebf6d9c3e2
Rename fp unwind test module to C stack unwind (#149563) 2026-05-08 14:58:38 +01:00
Diego Russo
2a8cece95c
Skip GNU backtrace test on Arm 32-bit (#149493) 2026-05-08 14:03:05 +01:00
Petr Viktorin
578411982c
gh-149486: tarfile.data_filter: validate written link target (GH-149487)
The data filter rewrote linknames with normpath() but ran the
containment check against the un-normalised value, and computed a
symlink's directory before stripping trailing slashes.  Both let a
crafted archive create links pointing outside the destination.  Also
reject link members that resolve to the destination directory itself,
which could otherwise replace it with a symlink and redirect all
subsequent members.

(Patch by Greg; Petr's just reviewing & merging.)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2026-05-08 14:16:06 +02:00
Diego Russo
2f6b3800e6
Add Diego as author of PEP 831 (#149551) 2026-05-08 12:58:48 +01:00
Hai Zhu
c341e341b2
gh-149459: Fix segfault when _LOAD_SPECIAL guard deoptimizes (#149478) 2026-05-08 11:20:27 +00:00
Neko Asakura
d2d24e46d3
gh-100239: expose sq_repeat helpers for BINARY_OP_EXTEND (#148791) 2026-05-08 11:12:20 +00:00
Malcolm Smith
52a05e8da7
gh-145176: Update CODEOWNERS for Emscripten migration to Platforms directory (#149544) 2026-05-08 14:08:07 +03:00
Nathan Goldbaum
3565d31690
docs: Clarify docs for error case of PyDict_GetItemRef (#149506) 2026-05-08 10:53:44 +00:00
Malcolm Smith
5b58fbc07c
gh-146445: Update CODEOWNERS for Android and iOS migration to Platforms directory (#149543) 2026-05-08 13:32:36 +03:00
Maurycy Pawłowski-Wieroński
d36e5b8644
gh-149521: Do not update last_profiled_frame if it's not changed (#149522) 2026-05-08 08:25:49 +00:00
sobolevn
4ae1a260c7
gh-149528: Remove annotationlib.ForwardRef._evaluate for 3.16 (#149529) 2026-05-08 07:48:15 +03:00
Neko Asakura
49918f5b0c
gh-149481: skip FOR_ITER inline specialization for Python __next__ (#149491)
Co-authored-by: Savannah Ostrowski <savannah@python.org>
Co-authored-by: Stan Ulbrych <stan@python.org>
2026-05-07 23:02:04 +00:00
Brett Cannon
b142878db1
Improve error messages when the WASI SDK can't be found (GH-149508) 2026-05-07 17:20:35 -05:00
Hugo van Kemenade
f0daba1652
gh-106693: Revert "Explicitly mark ob_sval as unsigned char to avoid UB (#106826)" (#149514) 2026-05-07 23:39:08 +03:00
Serhiy Storchaka
310fe88994
gh-79638: Treat an unreachable robots.txt as "disallow all" (GH-138555)
Disallow all access in urllib.robotparser if the robots.txt file is
unreachable due to server or network errors.
2026-05-07 22:06:57 +03:00
Pablo Galindo Salgado
fbba343622
gh-106693: Explicitly mark ob_sval as unsigned char to avoid UB (#106826)
Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
2026-05-07 22:06:53 +03:00
Stan Ulbrych
9d07159cda
gh-149499: Fixes for 3.16 bump (GH-149500)
Also fixes gh-149507, regenerating `configure` for 3.16.

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Zachary Ware <zach@python.org>
2026-05-07 19:06:37 +00:00
Hugo van Kemenade
f5c75351de Python 3.16.0a0 2026-05-07 19:05:52 +03:00
Hugo van Kemenade
f31a89bb90 Python 3.15.0b1 2026-05-07 16:26:31 +03:00
Diego Russo
299cf3c497
gh-126910: Update 3.15 what's new to include GDB/backtrace integration (#149494)
Update 3.15 what's new to include GDB/backtrace intergration
2026-05-07 16:05:29 +03:00
Neil Schemenauer
13188dbf85
gh-148937: revert process RSS based GC deferral (#149475) 2026-05-07 14:32:14 +03:00
Victor Stinner
b3cfd36ba4
gh-149202: Don't use -fno-omit-frame-pointer on ppc64le (#149485)
The power ABI specification requires that compilers maintain a back
chain by default, so unwinding already works without a dedicated
frame pointer. Don't use -fno-omit-frame-pointer on ppc64le.
2026-05-07 11:47:08 +02:00
Petr Viktorin
612140e7dd
gh-149202: Fix frame pointer unwinding on ppc64le and armv7/clang (#149409)
- ppc64's backchain format is also different from x86
- On 32-bit ARM, clang needs `-mno-thumb`, not `-marm` like GCC
2026-05-07 10:37:00 +02:00
Ned Deily
5fcab14c35
gh-142295: Update macOS framework build Info.plist files. (#149479)
For Python macOS framework builds, update all Info.plist files to be more
compliant with current Apple guidelines. Original patch contributed by
Martinus Verburg.
2026-05-06 23:52:23 -04:00