Commit graph

126221 commits

Author SHA1 Message Date
Brandt Bucher
002c4e2982
GH-129386: Use symbolic constants for specialization tests (GH-129415) 2025-01-29 10:49:58 -08:00
Taneli Hukkinen
99ed3025fe
gh-118761: Always lazy import warnings in threading (#129428) 2025-01-29 17:24:37 +00:00
Taneli Hukkinen
49f24650e4
gh-118761: Improve import time of subprocess (GH-129427)
* subprocess: lazy import signal and locale to improve module import time
2025-01-29 08:31:13 -08:00
Sam Gross
5ff2fbc026
gh-129236: Use stackpointer in free threaded GC (#129240)
The stack pointers in interpreter frames are nearly always valid now, so
use them when visiting each thread's frame. For now, don't collect
objects with deferred references in the rare case that we see a frame
with a NULL stack pointer.
2025-01-29 10:40:51 -05:00
Pieter Eendebak
a29221675e
gh-127119: Faster check for small ints in long_dealloc (GH-127620) 2025-01-29 15:22:18 +00:00
Zanie Blue
3a974e39d5
gh-129296: Fix pyatomic.h include paths (#129320)
Use relative includes in Include/cpython/pyatomic.h for
pyatomic_gcc.h, pyatomic_std.h and pyatomic_msc.h.

Do a similar change in Include/cpython/pythread.h for
pthread_stubs.h include.
2025-01-29 15:06:19 +00:00
Burkov Egor
25cf79a082
gh-129345: null check for indent syslogmodule (#129348) 2025-01-29 19:19:23 +05:30
Hugo van Kemenade
c67afb581e
CI: Change job name to 'build arm64' on Windows (#129434) 2025-01-29 13:18:19 +00:00
Srinivas Reddy Thatiparthy (తాటిపర్తి శ్రీనివాస్ రెడ్డి)
97b0ef05d9
gh-129409: Fix Integer overflow - SEGV while writing data more than 2GB in CSV file (#129413) 2025-01-29 11:15:47 +00:00
Irit Katriel
4815131910
gh-100239: specialize bitwise logical binary ops on ints (#128927) 2025-01-29 09:28:21 +00:00
🇺🇦 Sviatoslav Sydorenko (Святослав Сидоренко)
03d9cdb729
Merge TSAN test matrices in CI (#123278) 2025-01-29 11:16:51 +02:00
Pieter Eendebak
1a80214f11
gh-126703: Add freelists for list and tuple iterators (GH-128592) 2025-01-29 09:15:24 +00:00
Brandt Bucher
41ad2bb248
GH-128563: Don't leave frame->lltrace uninitialized (GH-129417) 2025-01-28 16:26:46 -08:00
Brandt Bucher
828b27680f
GH-126599: Remove the PyOptimizer API (GH-129194) 2025-01-28 16:10:51 -08:00
T. Wouters
5c930a26fb
gh-115999: Enable free-threaded specialization of LOAD_CONST (#129365)
Enable free-threaded specialization of LOAD_CONST.
2025-01-29 01:07:56 +01:00
Hood Chatham
789390872b
gh-127146: Skip test_readinto_non_blocking on Emscripten (#129421)
Skips an additional test due to non_blocking not working reliably on Emscripten.
2025-01-29 07:30:42 +08:00
Pieter Eendebak
64c417dee5
gh-112075: Remove critical section in dict.get (gh-129336)
The `dict.get` implementation uses `_Py_dict_lookup_threadsafe`, which is
thread-safe, so we remove the critical section from the argument clinic.

Add a test for concurrent dict get and set operations.
2025-01-28 21:55:45 +00:00
Barney Gale
a4459c34ea
GH-127381: pathlib ABCs: remove JoinablePath.match() (#129147)
Unlike `ReadablePath.[r]glob()` and `JoinablePath.full_match()`, the
`JoinablePath.match()` method doesn't support the recursive wildcard `**`,
and matches from the right when a fully relative pattern is given. These
quirks means its probably unsuitable for inclusion in the pathlib ABCs,
especially given `full_match()` handles the same use case.
2025-01-28 20:22:55 +00:00
Sam Gross
d23f5701ad
gh-128844: Make _Py_TryIncref public as an unstable API. (#128926)
This exposes `_Py_TryIncref` as `PyUnstable_TryIncref()` and the helper
function `_PyObject_SetMaybeWeakref` as `PyUnstable_EnableTryIncRef`.

These are helpers for dealing with unowned references in a safe way,
particularly in the free threading build.

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-01-28 19:32:27 +00:00
Samuel GIFFARD
7dd0a7e52e
gh-129408: http: Fix typo 'RFF' to RFC' in documentation (#129411) 2025-01-28 13:25:51 -05:00
Cody Maloney
180ee43bde
gh-129005: Avoid copy in _pyio.FileIO.readinto() (#129324)
`os.read()` allocated and filled a buffer by calling `read(2)`, than that
data was copied into the user provied buffer. Read directly into the
caller's buffer instead by using `os.readinto()`.

`os.readinto()` uses `PyObject_GetBuffer()` to make sure the passed
in buffer is writeable and bytes-like, drop the manual check.
2025-01-28 12:40:44 +01:00
Yury Manushkin
4d0d24f6e3
gh-112064: Fix incorrect handling of negative read sizes in HTTPResponse.read() (#128270)
The parameter `amt` of `HTTPResponse.read()`, which could be a negative integer,
has not been handled before and led to waiting for the connection to close
for `keep-alive connections`. Now, this has been fixed, and passing negative values
to `HTTPResponse().read()` works the same as passing `None` value.
2025-01-28 11:37:32 +00:00
Hood Chatham
8e57877e3f
gh-127146: Update test skips for Emscripten 4.0.1 (#129375)
Updates the Emscripten test skips to reflect recent changes in Emscripten capabilities.
2025-01-28 01:05:21 +00:00
RUANG (James Roy)
1c3bb200da
gh-85046: Document errno constants (#126420) 2025-01-28 01:12:45 +01:00
Erlend E. Aasland
379ab856f5
gh-129346: Handle allocation errors for SQLite aggregate context (#129347) 2025-01-27 18:16:19 +01:00
Sam Gross
a6a8c6f86e
gh-128954: Reorder _PyInterpreterFrame fields for reduced memory usage (#128958)
This reduces the size of _PyInterpreterFrame by 8 bytes on 64-bit
platforms using the free threading build due to alignment requirements.

This allows for slightly more recursive calls into the interpreter (from
C), but `test_call.test_super_deep` still crashes.
2025-01-27 17:14:51 +00:00
Victor Stinner
8a5a18a36e
gh-129205: Modernize test_eintr (#129316)
* Use f-string.
* Fix grammar: replace 'datas' with 'data' (and replace 'data' with
  'item').
* Remove unused variables: 'pid' and 'old_mask'.
* Factorize test_read() and test_readinto() code.

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2025-01-27 18:04:45 +01:00
Mark Shannon
75b4962157
GH-128914: Remove all but one conditional stack effects (GH-129226)
* Remove all 'if (0)' and 'if (1)' conditional stack effects

* Use array instead of conditional for BUILD_SLICE args

* Refactor LOAD_GLOBAL to use a common conditional uop

* Remove conditional stack effects from LOAD_ATTR specializations

* Replace conditional stack effects in LOAD_ATTR with a 0 or 1 sized array.

* Remove conditional stack effects from CALL_FUNCTION_EX
2025-01-27 16:24:48 +00:00
Nick Pope
8ec76d9034
gh-128427: Add uuid.NIL and uuid.MAX (#128429) 2025-01-27 18:17:17 +02:00
Victor Stinner
d8e16ef703
Cleanup What's New in Python 3.14 (C API changes) (#129341)
* Document PyDictObject.ma_version_tag removal.
* Add "Limited C API Changes" section.
* Move entries from New Features to Porting to Python 3.14.
* Include Pending removal documents at the right place.
2025-01-27 16:06:07 +01:00
Sergey Miryanov
a5075cd5bd
gh-119786: Fix small typo in AST to CFG to bytecode section in compiler.md (#129322) 2025-01-27 16:36:09 +02:00
Hugo van Kemenade
9546fe2ef2
gh-129061: Fix FORCE_COLOR and NO_COLOR when empty strings (#129140) 2025-01-27 16:24:10 +02:00
Bénédikt Tran
d6f010dead
gh-111178: fix UBSan failures in Modules/_decimal (GH-129074)
* Introduce & use cast macros
* fix UBSan failures for `PyDecContextObject`
* fix UBSan failures for `PyDecContextManagerObject`
* remove redundant casts for `PyDecObject`
2025-01-27 15:15:42 +01:00
Bénédikt Tran
ced296d2c0
gh-111178: fix UBSan failures in Python/traceback.c (GH-128259) 2025-01-27 15:07:39 +01:00
Bénédikt Tran
6bb03c7490
gh-111178: fix UBSan failures in Modules/socketmodule.c (GH-128249) 2025-01-27 15:06:10 +01:00
Bénédikt Tran
922cfecbce
gh-111178: fix UBSan failures in Modules/{blake2,md5,sha1,sha2,sha3}module.c (GH-128248)
- fix UBSan failures in `blake2module.c`
- fix UBSan failures in `md5module.c`
- fix UBSan failures in `sha1module.c`
- fix UBSan failures in `sha2module.c`
- fix UBSan failures in `sha3module.c`

Cosmetics:

- suppress unused return values
- remove redundant casts in constructors
- suppress unused parameters in `{md5,sha*,blake2}module.c`
2025-01-27 14:50:58 +01:00
Serhiy Storchaka
735f25c5e3
gh-119511: Fix a potential denial of service in imaplib (#119514)
The IMAP4 client could consume an arbitrary amount of memory when trying
to connect to a malicious server, because it read a "literal" data with a
single read(size) call, and BufferedReader.read() allocates the bytes
object of the specified size before reading. Now the IMAP4 client reads data
by chunks, therefore the amount of used memory is limited by the
amount of the data actually been sent by the server.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-01-27 14:44:00 +01:00
Peter Bierma
3fb5f6eb9b
gh-128509: Add PyUnstable_IsImmortal for finding immortal objects (GH-129182)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2025-01-27 14:36:33 +01:00
Victor Stinner
7ec17429d4
gh-102471: Change PyLongWriter_Discard(NULL) to do nothing (#129339)
It's convenient to be able to call PyLongWriter_Discard(NULL) in
error handling code.
2025-01-27 10:51:16 +00:00
Victor Stinner
11148e91e3
gh-102471: Credit Sergey B Kirpichev for PEP 757 (#129338) 2025-01-27 11:44:13 +01:00
Ken Jin
87fb8b198c
gh-128563: Move labels in ceval.c to bytecodes.c (GH-129112) 2025-01-27 18:30:20 +08:00
Tian Gao
7d275611f6
gh-124703: Do not raise an exception when quitting pdb (#124704) 2025-01-26 22:29:16 -05:00
Zanie Blue
a49225cc66
gh-129156: Fix variable quoting in android-env.sh script (#129321)
Adds quoting to `android-env.sh` to protect against spaces in paths.
2025-01-27 10:53:24 +08:00
Alex Willmer
a8dc6d6d44
gh-115911: Ignore PermissionError during import from cwd (#116131)
Ignore PermissionError when checking cwd during import

On macOS `getcwd(3)` can return EACCES if a path component isn't readable,
resulting in PermissionError. `PathFinder.find_spec()` now catches these and
ignores them - the same treatment as a missing/deleted cwd.

Introduces `test.support.os_helper.save_mode(path, ...)`, a context manager
that restores the mode of a path on exit.

This is allows finer control of exception handling and robust environment
restoration across platforms in `FinderTests.test_permission_error_cwd()`.

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Brett Cannon <brett@python.org>
2025-01-26 19:00:28 +00:00
Andrey Efremov
914c232e93
gh-127096: Do not recreate unnamed section on every read in ConfigParser (#127228)
* Do not recreate unnamed section on every read in ConfigParser

* Remove duplicate section creation code
2025-01-26 13:33:07 -05:00
donBarbos
5d9b62005a
gh-126107: Remove copyright block from Modules/config.c.in (#126982)
chore: remove copyright block from config.c.in
2025-01-26 16:57:32 +00:00
Jason R. Coombs
b543b32eff
gh-123987: Fix NotADirectoryError in NamespaceReader when sentinel present (#124018) 2025-01-26 16:23:54 +00:00
Thomas Grainger
fccbfc40b5
gh-129195: use future_add_to_awaited_by/future_discard_from_awaited_by in asyncio.staggered.staggered_race (#129253)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2025-01-26 21:14:16 +05:30
partev
a156b19424
gh-126022: Remove zope.org from the permitted linkcheck redirects (#129308) 2025-01-26 16:46:00 +02:00
Cody Maloney
1ed4487968
gh-129205: Add os.readinto() API for reading data into a caller provided buffer (#129211)
Add a new OS API which will read data directly into a caller provided
writeable buffer protocol object.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-01-26 14:21:03 +01:00