Commit Graph

124055 Commits

Author SHA1 Message Date
Sam Gross 3ea488aac4
gh-124218: Use per-thread refcounts for code objects (#125216)
Use per-thread refcounting for the reference from function objects to
their corresponding code object. This can be a source of contention when
frequently creating nested functions. Deferred refcounting alone isn't a
great fit here because these references are on the heap and may be
modified by other libraries.
2024-10-15 15:06:41 -04:00
Neil Schemenauer 206de4155b
gh-92953: Improve nextpool/prevpool comment. (gh-125545)
The meaning of these links depends on which list the pool is part of.
They are only the same size class if on the "usedpools" list.
2024-10-15 11:47:20 -07:00
Mikhail Efimov aac89b54c5
gh-125206: Bug in ctypes with old libffi is fixed (#125322)
Workaround for old libffi versions is added.
Module ctypes now supports C11 double complex only with libffi >= 3.3.0.

Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
2024-10-15 16:17:10 +00:00
Sam Gross 54c6fcbefd
gh-124375: Avoid calling `_PyMem_ProcessDelayed` on other thread states (#124459)
This fixes a crash when running the PyO3 test suite on the free-threaded
build. The `qsbr` field is initialized after the `PyThreadState` is
added to the interpreter's linked list -- it might still be NULL.

Instead, we "steal" the queue of to-be-freed memory blocks. This is
always initialized (possibly empty) and protected by the stop the world
pause.
2024-10-15 16:09:35 +00:00
Irit Katriel e97910cdb7
gh-125522 : add explicit exception types to bare excepts in tests (#125523) 2024-10-15 17:00:04 +01:00
Savannah Ostrowski c9826c11db
gh-89819: Add argument_default and conflict_handler to add_argument_group() docs (GH-125379) 2024-10-15 15:48:28 +00:00
Tian Gao bb9604b62a
gh-100141: Allow pdb to deal with empty file (#125425) 2024-10-15 11:45:23 -04:00
Victor Stinner c6e8ff86b2
gh-125451: Skip concurrent.futures test_processes_terminate() (#125533)
The test hangs randomly. It tries to serialize local lock and a local
function which are not possible.
2024-10-15 15:42:55 +00:00
Mikhail Efimov b903fc38d8
gh-119786: fix typo in compiler.md (#125456) 2024-10-15 16:38:19 +01:00
Tian Gao 703227dd02
gh-125422: Don't set the caller's f_trace if it's botframe (#125427) 2024-10-15 10:51:37 -04:00
Kirill Podoprigora d3c82b9cce
gh-125512: Revert "gh-124872: Replace enter/exit events with "switched" (#124776)" (#125513) 2024-10-15 17:42:16 +03:00
Irit Katriel 55c4f4c30b
gh-125514: fix bug in test_traceback utility. Specify exception types in except: clauses (#125516) 2024-10-15 15:11:02 +01:00
sobolevn c8a1818fb0
gh-125517: Fix unreachable code warnings in `_testembed.c` (#125518) 2024-10-15 13:12:32 +00:00
Petr Viktorin cc5a225cdc
gh-125041: test_zlib: For s390x HW acceleration, only skip checking the compressed bytes (#125042) 2024-10-15 11:29:43 +00:00
foreignmeloman fcef3fc9a5
gh-119535: Support 𝜋thon in Python 3.14 venvs (#125035) 2024-10-15 13:26:19 +03:00
Victor Stinner aa18fd55d5
gh-125196: Use PyUnicodeWriter in HAMT (#125458) 2024-10-15 09:47:36 +00:00
RUANG (Roy James) 546dddca43
gh-125234: Make PyInitConfig_Free(NULL) a no-op (#125266) 2024-10-15 09:21:16 +00:00
Serhiy Storchaka 92af191a6a
gh-53203: Fix strptime() tests for %X on glibc < 2.29 (#125469) 2024-10-15 11:05:40 +03:00
Hugo van Kemenade 66064c342c
gh-123299: Copyedit "What's New in Python 3.14" (#125438) 2024-10-15 10:39:15 +03:00
Mariusz Felisiak a2fe9ff11d
Doc: Update CVE URL (#125489) 2024-10-15 10:29:08 +03:00
Sam Gross 8d42e2d915
gh-125269: Use `AC_LINK_IF_ELSE` to detect if `-latomic` is needed (#125416)
We previously used `AC_RUN_IF_ELSE` with a short test program to detect
if `-latomic` is needed, but that requires choosing a specific default
value when cross-compiling because the test program is not run.
Some cross compilation targets like `wasm32-emscripten` do not support
`-latomic`, while other cross compilation targets, like
`arm-linux-gnueabi` require it.
2024-10-14 20:09:48 -04:00
Thomas Grainger 0b28ea4a35
gh-124958: Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles ... (#125486)
* Revert "gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476)"

This reverts commit e99650b80a.

* fix incompatability with gh-124392
2024-10-14 15:45:58 -07:00
Steven Jin 1bffd7a2a7
gh-124944: Add socket.SO_ORIGINAL_DST (#124945) 2024-10-15 00:36:38 +02:00
edson duarte 2a5cdb2516
gh-85453: Improve variable mark up for datetime.rst (#120702)
Variables and literals are marked up using backticks.
2024-10-15 00:02:58 +02:00
Terry Jan Reedy 3fea1d000e
Fix idlelib typos (#125484)
Propagate fixes in Doc/library/idle.rst to help.html.
Change 'interruptable' to 'interruptible' in run.py.
The latter was reported by ember91 in PR 125473.
2024-10-14 17:11:58 -04:00
sobolevn 0c8c665581
gh-125470: Fix warning in `Python/generated_cases.c.h` (#125471)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-10-14 23:46:17 +03:00
Richard Hansen 843d28f59d
gh-124872: Replace enter/exit events with "switched" (#124776)
Users want to know when the current context switches to a different
context object.  Right now this happens when and only when a context
is entered or exited, so the enter and exit events are synonymous with
"switched".  However, if the changes proposed for gh-99633 are
implemented, the current context will also switch for reasons other
than context enter or exit.  Since users actually care about context
switches and not enter or exit, replace the enter and exit events with
a single switched event.

The former exit event was emitted just before exiting the context.
The new switched event is emitted after the context is exited to match
the semantics users expect of an event with a past-tense name.  If
users need the ability to clean up before the switch takes effect,
another event type can be added in the future.  It is not added here
because YAGNI.

I skipped 0 in the enum as a matter of practice.  Skipping 0 makes it
easier to troubleshoot when code forgets to set zeroed memory, and it
aligns with best practices for other tools (e.g.,
https://protobuf.dev/programming-guides/dos-donts/#unspecified-enum).
2024-10-14 12:28:41 -07:00
Kirill Podoprigora e99650b80a
gh-125472: Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#12… (#125476)
Revert "gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959)"

This reverts commit d5dbbf4372.
2024-10-14 17:59:13 +00:00
Mikhail Efimov 187580d95c
gh-119786: [doc] broken link and typo fix in interpreter_definition.md (#125455) 2024-10-14 17:24:54 +00:00
Paul Hoffman 5dac0dceda
gh-125461: Remove Python 2 from identifiers in doc (GH-125462)
Remove Python 2 from identifiers in doc
2024-10-14 15:26:57 +00:00
Thomas Grainger d5dbbf4372
gh-124958: fix asyncio.TaskGroup and _PyFuture refcycles (#124959) 2024-10-14 08:19:56 -07:00
Mikhail Efimov 45df264f3f
gh-112088: aclocal version is updated to 1.16.5 in docs (#125457) 2024-10-14 16:53:08 +02:00
Bénédikt Tran c77121e9f1
gh-111178: fix USAN failures for `partialobject` (#124733) 2024-10-14 16:23:05 +02:00
Wulian 6a08a753b7
gh-124960: Fixed `barry_as_FLUFL` future flag does not work in new REPL (#124999)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-10-14 15:53:50 +02:00
Serhiy Storchaka 5f4e5b598c
gh-53203: Fix strptime() for %c, %x and %X formats on many locales (GH-125406)
Fixed most locales that use non-ASCII digits, like Persian, Burmese,
Odia and Shan.
2024-10-14 16:29:20 +03:00
Mark Shannon 06ca33020e
GH-125323: Convert DECREF_INPUTS_AND_REUSE_FLOAT into a function that takes PyStackRefs. (GH-125439) 2024-10-14 14:18:57 +01:00
Kumar Aditya 67f6e08147
gh-125139: use `_PyRecursiveMutex` in `_thread.RLock` (#125144) 2024-10-14 14:06:31 +05:30
Serhiy Storchaka 5217328f93
gh-121798: Add class method Decimal.from_number() (GH-121801)
It is an alternate constructor which only accepts a single numeric argument.
Unlike to Decimal.from_float() it accepts also Decimal.
Unlike to the standard constructor, it does not accept strings and tuples.
2024-10-14 08:24:01 +00:00
Ken Jin 4b358ee647
gh-125323: Remove some unsafe Py_DECREFs in bytecodes.c, replacing them with PyStackRef_CLOSEs (GH-125324) 2024-10-14 09:17:51 +01:00
Serhiy Storchaka b52c7306ea
gh-121797: Add class method Fraction.from_number() (GH-121800)
It is an alternative constructor which only accepts a single numeric argument.
Unlike to Fraction.from_float() and Fraction.from_decimal() it accepts any
real numbers supported by the standard constructor (int, float, Decimal,
Rational numbers, objects with as_integer_ratio()).
Unlike to the standard constructor, it does not accept strings.
2024-10-14 07:54:59 +00:00
rindeal 66b3922b97
gh-86357: argparse: use str() consistently and explicitly to print choices (GH-117766)
Signed-off-by: Jan Chren ~rindeal <dev.rindeal@gmail.com>
2024-10-14 09:36:53 +03:00
Sergey B Kirpichev cfc27bc50f
gh-123133: clarify p=0 case for "f" and "e" formatting types (GH-125426)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-10-13 21:44:48 -07:00
Sam Gross f1d33dbddd
gh-125243: Fix ZoneInfo data race in free threading build (#125281)
Lock `ZoneInfoType` to protect accesses to `ZONEINFO_STRONG_CACHE`.
Refactor the `tp_new` handler to use Argument Clinic so that we can just
use `@critical_section` annotations on the relevant functions.

Also use `PyDict_SetDefaultRef` instead of `PyDict_SetDefault` when
inserting into the `TIMEDELTA_CACHE`.
2024-10-13 16:17:51 -04:00
Barney Gale cb8e5995d8
GH-125069: Fix inconsistent joining in `WindowsPath(PosixPath(...))` (#125156)
`PurePath.__init__()` incorrectly uses the `_raw_paths` of a given
`PurePath` object with a different flavour, even though the procedure to
join path segments can differ between flavours.

This change makes the `_raw_paths`-enabled deferred joining apply _only_
when the path flavours match.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-10-13 17:46:10 +00:00
Sergey B Kirpichev c6d7b644c2
gh-101291: Add versionadded directives for PyUnstable_Long_* (#125384) 2024-10-13 19:38:42 +02:00
Kumar Aditya e79bbd147f
add Kumar Aditya as codeowner for weakref (#125405) 2024-10-13 16:59:27 +00:00
partev 6c386b703d
gh-125403: fix console formatting in Chapter 12 of the tutorial (#125404) 2024-10-13 22:16:15 +05:30
Kumar Aditya cd0f9d111a
gh-89967: make WeakKeyDictionary and WeakValueDictionary thread safe (#125325)
Make `WeakKeyDictionary` and `WeakValueDictionary` thread safe by copying the underlying the dict before iterating over it.
2024-10-13 21:05:05 +05:30
Kumar Aditya 08489325d1
gh-125161: return non zero value in pthread_self on wasi (#125303) 2024-10-13 20:59:41 +05:30
Kumar Aditya 022c50d190
fix comment in _PyMutex_TryUnlock (#125319) 2024-10-13 20:59:07 +05:30