125963 Commits

Author SHA1 Message Date
Mark Shannon
fd545d735d
GH-127705: Move mortal decrefs to internal header and make sure _PyReftracerTrack is called 2025-03-17 17:23:50 +00:00
Mark Shannon
9881fc5483
GH-125174: Make immortality "sticky" (GH-131355)
* Use a higher threshold for immortality for INCREF than DECREF
2025-03-17 17:22:35 +00:00
Victor Stinner
aabab76c8a
gh-131268: Adjust _PYTHREAD_NAME_MAXLEN on BSD (#131345)
Adjust _PYTHREAD_NAME_MAXLEN constant on FreeBSD and NetBSD.
Initial patch by Xavier G.
2025-03-17 16:52:59 +00:00
Ken Jin
b2ed7a6d6a
gh-131281: Add include for pystats builds (#131369)
Add include to for pystats builds
2025-03-18 00:36:06 +08:00
Chris Eibl
ef4fe70785
GH-131291: Suppress clang-specific warning in python_uwp.cpp (GH-131292) 2025-03-17 16:22:25 +00:00
Petr Viktorin
30d5205849
gh-116666: Add "token" glossary term (GH-130888)
Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-03-17 17:05:47 +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
Yuki Kobayashi
9a634c5c0c
Docs: Fix incorrect sphinx markup for a class member (GH-130970) 2025-03-17 16:28:56 +01: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
Victor Stinner
0453e494b6
gh-131238: Convert pycore_pystate.h static inline to functions (#131352)
Convert static inline functions to functions:

* _Py_IsMainThread()
* _PyInterpreterState_Main()
* _Py_IsMainInterpreterFinalizing()
* _Py_GetMainConfig()
2025-03-17 12:31:55 +01:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
80e00ecc39
gh-129843: fix pure Python implementation of warnings.warn_explicit (#129848)
The pure Python implementation of `warnings.warn_explicit` constructs a `WarningMessage`
with an incorrect source (it incorrectly sets the WarningMessage's line to the given `source`).
2025-03-17 10:49:53 +00: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
Bénédikt Tran
de8890f5ab
gh-130149: cleanup refactorization of test_hmac.py (#131318)
New features:

* refactor `hashlib_helper.requires_hashdigest` in prevision of a future
  `hashlib_helper.requires_builtin_hashdigest` for built-in hashes only
* add `hashlib_helper.requires_openssl_hashdigest` to request OpenSSL
   hashes, assuming that `_hashlib` exists.

Refactoring:

* split hmac.copy() test by implementation
* update how algorithms are discovered for RFC test cases
* simplify how OpenSSL hash digests are requested
* refactor hexdigest tests for RFC test vectors
* typo fix: `assert_hmac_hexdigest_by_new` -> `assert_hmac_hexdigest_by_name`

Improvements:

* strengthen contract on `hmac_new_by_name` and `hmac_digest_by_name`
* rename mixin classes to better match their responsibility
2025-03-17 11:10:03 +01:00
Semyon Moroz
85c04f80fd
gh-93096: Update and document pickletools CLI (#131273) 2025-03-17 09:36:30 +00: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
Nybblista
3ae67ba97e
gh-131339: test PyBytes_Size for a zero-size bytes object (#131340) 2025-03-17 11:38:37 +03:00
Hood Chatham
cf288e3c25
gh-127146: Update test skips for Emscripten 4.0.2 (#129474)
Updates test skips to reflect capabilities of Emscripten 4.0.2.
2025-03-17 06:02:27 +08:00
Nybblista
23cda58348
gh-119786: add JUMP_BACKWARD macro to the Jumps section (#131213)
add JUMP_BACKWARD opcode macro to the Jumps section

JUMP_BACKWARD opcode macro added to the Jumps section in
interpreter.md file at InternalDocs.
2025-03-16 20:04:39 +00:00
Tomas R.
d07e9ebbe8
gh-131306: Remove unused code related to BINARY_SUBSCR (#131307) 2025-03-16 16:37:29 +00:00
AN Long
bf4c1bf344
gh-131327: Document winsound.SND_APPLICATION (#131328)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 16:27:24 +01:00
Bénédikt Tran
9b6cef0f5d
gh-131254: ensure that BROWSER is not set for test_webbrowser on macOS (#131276) 2025-03-16 15:39:30 +01:00
Bénédikt Tran
3185e3115c
gh-131277: allow EnvironmentVarGuard to unset more than one environment variable at once (#131280)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-16 14:09:33 +01:00
donBarbos
9558d22ac3
gh-130160: use .. program:: directive for documenting doctest CLI (#131034)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-03-16 11:53:22 +00:00
Barney Gale
563ab5cefe
GH-130614: pathlib ABCs: improve support for receiving path metadata (#131259)
In the private pathlib ABCs, replace `_WritablePath._write_info()` with
`_WritablePath._copy_from()`. This provides the target path object with
more control over the copying process, including support for querying and
setting metadata *before* the path is created.

Adjust `_ReadablePath.copy()` so that it forwards its keyword arguments to
`_WritablePath._copy_from()` of the target path object. This allows us to
remove the unimplemented *preserve_metadata* argument in the ABC method,
making it a `Path` exclusive.
2025-03-16 06:11:20 +00:00
Chris Eibl
e82c2ca2a5
GH-131296: fix clang-cl warnings on Windows in pyshellext.cpp (GH-131300)
fix unused warnings in pyshellext.cpp
2025-03-15 18:55:00 +00:00
Chris Eibl
f104c19a94
GH-131296: fix clang-cl warning on Windows in pytime.c (GH-131297)
fix warning : integer literal is too large

to be represented in a signed integer type,
interpreting as unsigned [-Wimplicitly-unsigned-literal]
2025-03-15 11:41:34 -07: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
donBarbos
7ae9c5dd25
gh-130160: use .. program:: directive for documenting http.server CLI (#131010) 2025-03-15 18:28:56 +02:00
Xuanteng Huang
1821f8f10c
gh-131281: fix compile error due to BINARY_SUBSCR (GH-131283)
* fix compile error due to `BINARY_SUBSCR`

* replace stat_inc with `BINARY_OP`
2025-03-15 23:38:46 +08:00
Yan Yanchii
55815a6474
gh-130480: Move duplicate LOAD_SMALL_INT optimization from codegen to CFG (#130481) 2025-03-14 21:23:27 +00:00
Tian Gao
26511993e6
gh-121468: Fix the doctest failure for asyncio test on pdb (#131258) 2025-03-14 16:23:21 -04:00
Barney Gale
633942e348
GH-130614: pathlib ABCs: delete vestigial test_pathlib_abc module (#131215)
Remove the `test.test_pathlib.test_pathlib_abc` test module, which was
hollowed out in previous commits. Its few remaining tests are most relevant
to `PurePath` and `Path`, so we move them into `test_pathlib`.
2025-03-14 20:04:07 +00:00
Tian Gao
27fc62cf4f
gh-121468: Add current asyncio task as a convenience variable in pdb (#124367) 2025-03-14 14:46:26 -04:00
Hugo van Kemenade
c107b15ab8 Post 3.14.0a6 2025-03-14 19:09:56 +02:00
Hugo van Kemenade
77b2c933ca Python 3.14.0a6 v3.14.0a6 2025-03-14 17:05:02 +02:00
Hugo van Kemenade
ca1bedc9a4
gh-121970: Revert "GH-121970: Extract `pydoc_topics` into a new extension (#129116)" (#131245)
Revert "GH-121970: Extract ``pydoc_topics`` into a new extension (#129116)"

This reverts commit 01bcf13a1c5bfca5124cf2e0679c9d1b25b04708.
2025-03-14 16:25:56 +02: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
donBarbos
f9d0531a8d
gh-93096: Update and document pickle CLI (#131097)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-14 14:15:35 +01:00
Mark Shannon
67af96c61c
GH-127705: Handle trace refs in specialized decref (GH-131198)
This is missing `_PyReftracerTrack` calls, see gh-131238.
Merging as-is for the 3.14.0a6 release.
2025-03-14 13:02:09 +01:00
sobolevn
fc07f863ee
gh-131234: Improve test_popen with more asserts (#131235) 2025-03-14 11:38:31 +00:00
Mark Shannon
2250ab6a13
GH-125174 Revert: Make immortality "sticky" (GH-131184)" (#131230)
Revert "GH-125174: Make immortality "sticky" (GH-131184)"

This reverts commit 3a91ee97245639c7c4f8852418157d3fc0ec1a82.
2025-03-14 13:13:47 +02:00
Wulian233
7fd61607cd
gh-131204: Fix difflib.HtmlDiff may not use monospaced font (#131221)
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-03-14 10:45:33 +00:00
Hugo van Kemenade
3d797e49c8
gh-92897: Doc: the check_home removal has been scheduled for 3.15 (#130586) 2025-03-14 12:29:23 +02:00
sobolevn
f6c24a5c89
gh-131219: Improve tests in test_lzma.py by adding more asserts (#131220) 2025-03-14 10:16:50 +00:00