Commit graph

55480 commits

Author SHA1 Message Date
Petr Viktorin
639df39bf0
gh-131146: Fall back to month_name if standalone_month_names aren't distinct (GH-137674)
Some systems reportedly don't expand '%OB' and '%Ob'.
In this case (and similar theoretically possible ones, like expanding to empty
string or 'OB'), fall back to the month_name & month_abbr.
2025-08-13 07:03:05 +00:00
Adam Turner
6baf552484
GH-137623: Begin enforcing docstring length in Argument Clinic (#137624) 2025-08-12 20:17:35 +00:00
Adam Turner
be56464c4b
GH-137630: Convert `_interpreters` to use Argument Clinic (#137631) 2025-08-12 16:23:13 +01:00
Jelle Zijlstra
6859b95cff
gh-135228: When @dataclass(slots=True) replaces a dataclass, make the original class collectible (take 2) (GH-137047)
Remove the `__dict__` and `__weakref__` descriptors from the original class when creating a dataclass from it.

An interesting hack, but more localized in scope than gh-135230.

This may be a breaking change if people intentionally keep the original class around
when using `@dataclass(slots=True)`, and then use `__dict__` or `__weakref__` on the
original class.


Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-12 13:16:54 +02:00
Serhiy Storchaka
027cacb67c
gh-126008: Improve docstrings for Tkinter cget and configure methods (GH-133303)
* Explain the behavior of Widget.configure() depending on arguments.
* Unify descriptions.
* Replace "resource" with "option".
2025-08-12 07:55:01 +03:00
Brett Cannon
7140b99b0d
GH-137426: Remove code deprecation of importlib.abc.ResourceLoader (GH-137567)
Enough other classes in `importlib.abc` inherit from the class and the deprecation was to redirect people to `TraversableResources`. The documentation now makes it clear the class only exists for backwards compatibility.

---------

Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-08-11 16:18:54 -07:00
Sam Gross
362692852f
gh-137400: Fix a crash when disabling profiling across all threads (gh-137471)
The `PyEval_SetProfileAllThreads` function and other related functions
had a race condition on `tstate->c_profilefunc` that could lead to a
crash when disable profiling or tracing on all threads while another
thread is starting to profile or trace a a call.

There are still potential crashes when threads exit concurrently with
profiling or tracing be enabled/disabled across all threads.
2025-08-11 11:41:44 -04:00
AN Long
deb0020e3d
gh-115766: Fix IPv4Interface.is_unspecified (GH-137326) 2025-08-11 15:04:47 +02:00
László Kiss Kollár
4497ad409e
gh-135953: Profile a module or script with sampling profiler (#136777) 2025-08-11 12:36:43 +01:00
Serhiy Storchaka
1bde13b0e9
Add test for opening an SQLite with bytes path (GH-136331) 2025-08-11 09:16:54 +03:00
Malcolm Smith
b36d23f58e
Update pre-commit hooks (#137591)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-10 22:32:50 +00:00
Peter Bierma
55788a9096
gh-137583: Only lock the SSL context, not the SSL socket (GH-137588)
Fixes a deadlock in 3.13.6.
2025-08-10 14:47:11 +00:00
Serhiy Storchaka
046a4e39b3
gh-136571: Convert more code in datetime to Argument Clinic (GH-136573)
This adds signatures for some classes and methods.

date.fromisocalendar() can now raise OverflowError for arguments that
don't fit in the C int.
2025-08-09 18:25:49 +00:00
Nick Burns
d7dbde8958
gh-92936: allow double quote in cookie values (#113663)
* allow double quote in cookie values
* Update Lib/test/test_http_cookies.py

Co-authored-by: Senthil Kumaran <senthil@python.org>
2025-08-08 12:07:15 -07:00
Douglas Thor
34d7351ac7
gh-133722: Add Difflib theme to _colorize and 'color' option to difflib.unified_diff (#133725) 2025-08-08 18:34:02 +03:00
Sergey Miryanov
25518f51dc
GH-135552: Add tests to check weakref clearing (GH-136304)
These are tests to ensure behaviour introduced by GH-136189 is working as expected.

Co-authored-by: Mikhail Borisov <43937008+fxeqxmulfx@users.noreply.github.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
2025-08-07 17:45:33 -07:00
Neil Schemenauer
350c58ba4e
GH-135552: Make the GC clear weakrefs later (GH-136189)
Fix a bug caused by the garbage collector clearing weakrefs too early.  The
weakrefs in the ``tp_subclasses`` dictionary are needed in order to correctly
invalidate type caches (for example, by calling ``PyType_Modified()``).
Clearing weakrefs before calling finalizers causes the caches to not be
correctly invalidated.  That can cause crashes since the caches can refer to
invalid objects.  Defer the clearing of weakrefs without callbacks until after
finalizers are executed.
2025-08-07 16:32:17 -07:00
Bénédikt Tran
deb385a143
gh-137412: fix default_builtin_hashes values in test_hashlib.py (#137413)
fix `default_builtin_hashes` in test_hashlib
2025-08-07 15:31:56 -07:00
Dino Viehland
375f484f97
gh-137291: Support perf profiler with an evaluation hook (#137292)
Support perf profiler with an evaluation hook
2025-08-07 14:54:12 -07:00
maurycy
db8742e2b4
Remove redundant assignment in asyncio.streams.StreamReaderProtocol.connection_lost() (GH-137524)
The _stream_writer attribute was removed in a355f60 (gh-114914).
2025-08-07 18:38:14 +03:00
Serhiy Storchaka
baefaa6cba
gh-137044: Support large limit values in getrlimit() and setrlimit() (GH-137338)
* Return large limit values as positive integers instead of negative integers
  in resource.getrlimit().
* Accept large values and reject negative values (except RLIM_INFINITY)
  for limits in resource.setrlimit().
2025-08-07 11:06:37 +03:00
Guilherme Leobas
5be872350d
gh-137463: Update validate_abstract_methods in test_collections.py (#137464)
Update `validate_abstract_methods` in `test_collections.py`

The test for missing abstract methods in `validate_abstract_methods` incorrectly attempted to instantiate the generated class `C` with an argument (`C(name)`), which always raises a `TypeError: C() takes no arguments`. Although the test originally passes, it passes for the wrong reason.

This change makes the test correctly validate the enforcement of abstract methods in ABCs.
2025-08-07 09:10:56 +03:00
Isuru Fernando
3000594e92
gh-84683: Check <prefix>/share/zoneinfo for zoneinfo files on Windows (GH-28495) 2025-08-06 23:05:41 +01:00
Daniele Parmeggiani
ee72c95aa9
gh-134861: Add 🍌SV output format to `python -m asyncio ps` (#137486)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-06 20:42:34 +00:00
Daniele Parmeggiani
470cbe97a5
gh-134861: Add CSV output format to `python -m asyncio ps` (#134862)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-08-06 20:10:40 +00:00
Barney Gale
f0a3c6ebc9
GH-137466: Remove deprecated and undocumented glob.glob0() and glob1() (#137467) 2025-08-06 17:13:58 +01:00
Alexander Urieles
481d5b5455
gh-75989: TarFile.extractall and TarFile.extract now overwrite symlinks when extracting hardlinks (GH-137316) 2025-08-06 14:59:22 +02:00
Victor Stinner
ce1b747ff6
gh-58124: Avoid CP_UTF8 in UnicodeDecodeError (#137415)
Fix name of the Python encoding in Unicode errors of the code page
codec: use "cp65000" and "cp65001" instead of "CP_UTF7" and "CP_UTF8"
which are not valid Python code names.
2025-08-06 14:35:27 +02:00
Irit Katriel
1f2026b8a2
gh-137288: Fix bug where boolean expressions are not associated with the correct exception handler (#137310) 2025-08-05 19:25:57 +01:00
naweiss
a50822ff94
gh-107545: Fix misleading setsockopt() error messages (GH-107546) 2025-08-05 10:16:14 +00:00
Furkan Onder
7f416c8674
gh-137397: Skip test_os_open on NetBSD due to indefinite hang (#137398) 2025-08-05 10:32:21 +02:00
Bénédikt Tran
0af7556b94
gh-136306: fix test_ssl.ContextTests.test_set_groups on FIPS builds (#137405)
X25519 is not a valid curve if OpenSSL is built with FIPS mode,
and ignoring unknown groups in `SSL_CTX_set1_groups_list()`
is only supported since OpenSSL 3.3, so we use two curves that
are known to be FIPS-compliant, namely P-256 and P-384.
2025-08-05 07:50:34 +00:00
alexey semenyuk
c5cebe1b5a
gh-137128: Remove outdated todo about coro_fns in asyncio (#137385) 2025-08-04 16:44:29 +00:00
Victor Stinner
08ce7c6958
gh-129033: Remove dead code in test.support.has_no_debug_ranges() (#137379) 2025-08-04 16:48:24 +02:00
Peter Bierma
e8251dc0ae
gh-134170: Add colorization to unraisable exceptions (#134183)
Default implementation of sys.unraisablehook() now uses traceback._print_exception_bltin() to print exceptions with colorized text.

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-08-04 14:35:00 +00:00
Alexander Urieles
3ec3d05345
gh-81325: Support path-like objects with streaming TarFile (#137188)
Co-authored-by: Emma Smith <emma@emmatyping.dev>
2025-08-03 19:53:01 -07:00
Sergey B Kirpichev
b266fbc9ec
gh-122450: Expand documentation for `Rational and Fraction` (#136800)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-08-04 02:15:59 +00:00
Richard Si
506542b596
gh-137257: Upgrade bundled pip to 25.2 (GH-137258) 2025-08-03 22:00:17 -04:00
Serhiy Storchaka
1612dcbafe
gh-137341: Remove more word duplications (GH-137342) 2025-08-03 19:41:12 +03:00
Pablo Galindo Salgado
0153d82a5a
gh-137314: Fix incorrect treatment of format specs in raw fstrings (#137328) 2025-08-03 17:10:51 +01:00
sobolevn
158b28dd19
gh-137191: Fix how type parameters are collected from Protocol and Generic bases with parameters (#137281) 2025-08-03 10:40:55 +03:00
sobolevn
b74f3bed51
gh-137308: Replace a single docstring with pass in -OO mode (#137318)
This is required so we would never have empty node bodies.
Refs #130087
2025-08-02 11:57:01 +00:00
Serhiy Storchaka
718e0c89ba
gh-137273: Fix debug assertion failure in locale.setlocale() on Windows (GH-137300)
It happened when there were at least 16 characters after dot in the
locale name.
2025-08-01 17:43:53 +03:00
Kumar Aditya
e99bc7fd44
gh-133467: fix data race in type_set_name (#137302)
Fix data race in `type_set_name` by assigning name under stop the world pause making it thread safe in free-threading.
2025-08-01 13:40:40 +00:00
Henry Schreiner
2a87af062b
gh-137282: Fix TypeError in tab completion and dir() of concurrent.futures (GH-137214)
Signed-off-by: Henry Schreiner <henryschreineriii@gmail.com>
2025-07-31 16:17:27 +00:00
Xuanteng Huang
d18f73ae13
gh-137200: support frame lineno setter with BRANCH_LEFT and BRANCH_RIGHT events (GH-137229) 2025-07-31 14:22:22 +01:00
Dzmitry Plashchynski
438cbd857a
gh-131146: Fix month names in a "standalone form" in calendar module (GH-131147)
The calendar module displays month names in some locales using the genitive case.
This is grammatically incorrect, as the nominative case should be used when the month
is named by itself. To address this issue, this change introduces new lists
`standalone_month_name` and `standalone_month_abbr` that contain month names in
the nominative case -- or more generally, in the form that should be used to
name the month itself, rather than form a date.

The module now uses the `%OB` format specifier to get month names in this form
where available.
2025-07-31 14:06:33 +02:00
Jeong, YunWon
0282eef880
gh-137194: Fix requires_debug_ranges when _testcpi doesn't exist (GH-137195) 2025-07-31 14:22:11 +03:00
Krzysztof Magusiak
b723c8be07
gh-124503: Optimize ast.literal_eval() for small input (GH-137010)
The implementation does not create anymore local functions which reduces
the overhead for small inputs. Some other calls are inlined into a
single `_convert_literal` function.
We have a gain of 10-20% for small inputs and only 1-2% for bigger
inputs.
2025-07-31 12:55:00 +03:00
Stan Ulbrych
5f35f9b8fa
gh-137239: Add *_max functions to heapq.__all__ (gh-137241) 2025-07-30 16:12:14 -05:00