Commit Graph

122805 Commits

Author SHA1 Message Date
Miss Islington (bot) 4fa46cfdbd
[3.13] Document ``mimetypes.MimeTypes.add_type()`` (GH-122301) (#122328)
Document ``mimetypes.MimeTypes.add_type()`` (GH-122301)
(cherry picked from commit d52726ccd4)

Co-authored-by: Subrahmanya Gaonkar <148525245+negativenagesh@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-26 22:20:01 +00:00
Miss Islington (bot) 9d5dde5006
[3.13] gh-122201: Lock mutex when setting handling_thread to NULL (GH-122204) (#122319)
In the free-threaded build, we need to lock pending->mutex when clearing
the handling_thread in order not to race with a concurrent
make_pending_calls in the same interpreter.
(cherry picked from commit c557ae97d6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-26 17:30:08 +00:00
Miss Islington (bot) 816a1572e5
[3.13] gh-122311: Fix typo in the pickle error formatting code (GH-122312) (GH-122314)
(cherry picked from commit 7c2921844f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-26 15:13:59 +00:00
Mark Shannon 9162da254a
[3.13] GH-122155: Fix cases generator to correctly compute 'peek' offset for error handling (GH-122158) (GH-122174) 2024-07-26 10:51:42 +01:00
Miss Islington (bot) 9059780987
[3.13] Move macOS matrix to the calling workflow (GH-121809) (#122297)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-07-25 20:56:11 +00:00
Miss Islington (bot) aca41cfe99
[3.13] GH-121832: Assert that the version number of static builtin types is not changed by PyType_Modified (gh-122290)
Update datetime module and test_type_cache.py to not call PyType_Modified.

(cherry picked from commit e55b05f29e, AKA gh--122182)

Co-authored-by: Mark Shannon <mark@hotpy.org>
2024-07-25 17:34:01 +00:00
Miss Islington (bot) dd270f610c
[3.13] gh-121489: Export private _PyBytes_Join() again (GH-122267) (#122287)
gh-121489: Export private _PyBytes_Join() again (GH-122267)
(cherry picked from commit aef95eb107)

Co-authored-by: Marc Mueller <30130371+cdce8p@users.noreply.github.com>
2024-07-25 16:06:31 +00:00
Miss Islington (bot) 88a96fc391
[3.13] gh-116322: Fix typo in the GH-ifdef check (GH-122268) (#122284)
gh-116322: Fix typo in the GH-ifdef check (GH-122268)
(cherry picked from commit 9bb2e4623f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-25 14:58:34 +00:00
Miss Islington (bot) d1af4f5372
[3.13] gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` (GH-122269) (#122278)
gh-121913: Use str(exc) instead of exc.strerror in `asyncio.base_events` (GH-122269)
(cherry picked from commit 070f1e2e5b)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-07-25 12:20:40 +00:00
Miss Islington (bot) 83bfc5bd8b
[3.13] gh-122270: Fix typos in the Py_DEBUG macro name (GH-122271) (GH-122275)
(cherry picked from commit 6c09b8de5c)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-25 11:29:22 +00:00
Miss Islington (bot) 984f8aaa2f
[3.13] gh-82951: Fix serializing by name in pickle protocols < 4 (GH-122149) (GH-122264)
Serializing objects with complex __qualname__ (such as unbound methods and
nested classes) by name no longer involves serializing parent objects by value
in pickle protocols < 4.
(cherry picked from commit dc07f65a53)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-25 13:44:55 +03:00
Miss Islington (bot) 977c799286
[3.13] gh-122187: Avoid TSan reported race in `run_udp_echo_server` (GH-122189) (#122263)
gh-122187: Avoid TSan reported race in `run_udp_echo_server` (GH-122189)

TSan doesn't fully recognize the synchronization via I/O, so ensure that
socket name is retrieved earlier and use a different socket for sending
the "STOP" message.
(cherry picked from commit 2f74b709b6)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-25 08:42:38 +00:00
Miss Islington (bot) 6933c4ace9
[3.13] gh-113785: csv: fields starting with escapechar are not quoted (GH-122110) (GH-122258)
(cherry picked from commit a3327dbfd4)

Co-authored-by: Mikołaj Kuranowski <mkuranowski@gmail.com>
2024-07-25 07:29:36 +00:00
Miss Islington (bot) 94db4cc5e6
[3.13] gh-122191: Fix test_warnings failure if run with -Werror (GH-122222) (GH-122256)
__spec__.loader is now required in the module globals (see gh-86298).
(cherry picked from commit 9b4fe9b718)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-07-25 07:28:33 +00:00
Serhiy Storchaka 4e7716554b
[3.13] gh-122087: Restore ismethoddescriptor() and isroutine() for partial objects (GH-122218)
Now they return False again.
2024-07-25 10:11:47 +03:00
Eric Snow 716c6771fc
[3.13] gh-117482: Simplify the Fix For Builtin Types Slot Wrappers (gh-121932)
In gh-121602, I applied a fix to a builtin types initialization bug.
That fix made sense in the context of some broader future changes,
but introduced a little bit of extra complexity.  For earlier versions
those future changes are not relevant; we can avoid the extra complexity.
Thus we can revert that earlier change and replace it with this one,
which is more focused and conceptually simpler.  This is essentially
the implementation of an idea that @markshannon pointed out to me.

Note that this change would be much smaller if we didn't have to deal
with repr compatibility for builtin types that explicitly inherit tp slots
(see expect_manually_inherited()).  The alternative is to stop
*explicitly* inheriting tp slots in static PyTypeObject values,
which is churn that we can do separately.
2024-07-24 12:02:36 -06:00
Miss Islington (bot) 0952ea94d9
[3.13] Integrate `build_msi` into main CI workflow (GH-121778) (#122226)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-24 04:57:41 -06:00
Hugo van Kemenade a68237c304
[3.13] gh-122085: Use include files for `whatsnew/3.12.rst` deprecations, including 3.16 (GH-122093) (#122225) 2024-07-24 04:15:56 -06:00
Hugo van Kemenade bde9df829c
[3.13] gh-122085: Use include files for `whatsnew/3.12.rst` deprecations (GH-122093) (#122223) 2024-07-24 09:09:48 +00:00
Miss Islington (bot) ba3aa5a0ef
[3.13] GH-120754: Add more tests around seek + readall (GH-122103) (#122215)
GH-120754: Add more tests around seek + readall (GH-122103)

In the process of speeding up readall, A number of related tests
(ex. large file tests in test_zipfile) found problems with the
change I was making. This adds I/O tests to specifically test these
cases to help ensure they don't regress and hopefully make debugging
easier.

This is part of the improvements from
https://github.com/python/cpython/pull/121593GH-issuecomment-2222261986
(cherry picked from commit 9eb734111b)

Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
2024-07-24 06:44:41 +00:00
Miss Islington (bot) 40cdec6a8a
[3.13] gh-122029: Log call events in sys.setprofile when it's a method with c function (GH-122072) (GH-122205)
gh-122029: Log call events in sys.setprofile when it's a method with c function (GH-122072)

Log call events in sys.setprofile when it is a method with a C function.
(cherry picked from commit e91ef13861)

Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-07-23 22:49:36 +00:00
Miss Islington (bot) 81f9339022
[3.13] gh-121832: Skip subinterpreter static type check on iOS to restore test suite. (GH-122150) (#122159)
gh-121832: Skip subinterpreter static type check on iOS to restore test suite. (GH-122150)
(cherry picked from commit 1bcc9eb862)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-07-23 22:48:02 +00:00
Eric Snow 8567a5e97d
[3.13] gh-122199: Skip test_slot_wrappers When Checking For Refleaks (gh-122202)
(cherry picked from commit 41a91bd67f, AKA gh-122200)
2024-07-23 21:53:39 +00:00
Miss Islington (bot) e0f540d413
[3.13] gh-117657: Skip tests that use threads after fork (GH-122194) (#122198)
These tests fail when run under thread sanitizer due to the use of fork
and threads.
(cherry picked from commit 64e221d7ad)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-23 21:00:21 +00:00
Miss Islington (bot) 1d601a1da1
[3.13] gh-117482: Expand Tests for Slot Wrappers of Inherited Slots of Static Builtin Types (gh-122195)
(cherry picked from commit 33d32faa58, AKA gh-122192)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-07-23 20:22:24 +00:00
Miss Islington (bot) 77ab53a5f3
[3.13] gh-120974: Make _asyncio._leave_task atomic in the free-threaded build (GH-122139) (#122186)
gh-120974: Make _asyncio._leave_task atomic in the free-threaded build (GH-122139)

* gh-120974: Make _asyncio._leave_task atomic in the free-threaded build

Update `_PyDict_DelItemIf` to allow for an argument to be passed to the
predicate.
(cherry picked from commit a15feded71)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-23 17:30:58 +00:00
Miss Islington (bot) 214b430faf
[3.13] gh-121973: Fix flaky test_pyrepl tests (GH-122140) (GH-122173)
This fixes the flakiness in:
* test_inspect_keeps_globals_from_inspected_file
* test_inspect_keeps_globals_from_inspected_module

The output already includes newlines. Adding newlines for every entry in
the output list introduces non-determinism because it added '\n' in
places where stdout is flushed or some buffer becomes full.

The regex also needed to be updated because pyrepl includes control
characters -- the visible output on each line doesn't immediately follow
a newline character.

(cherry picked from commit 2c1b1e7a07)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-23 15:57:24 +02:00
Miss Islington (bot) ae9e02c508
[3.13] Docs: Use cross-reference to `os.uname` in `sysconfig.get_platform` (GH-122083) (#122171)
Docs: Use cross-reference to `os.uname` in `sysconfig.get_platform` (GH-122083)
(cherry picked from commit 498cb6dff1)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
2024-07-23 13:29:46 +00:00
Miss Islington (bot) 44ec777eff
[3.13] gh-85453: Fix 'timezone' vs. 'time zone' spelling issues in datetime.rst (GH-118449) (#121837)
(cherry picked from commit 1755df7b3b)

Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-07-23 13:27:31 +00:00
Miss Islington (bot) 3b013fc208
[3.13] GH-121970: Remove ``escape4chm`` (GH-122065) (#122167)
GH-121970: Remove ``escape4chm`` (GH-122065)
(cherry picked from commit 53e9e7de63)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-23 12:48:23 +00:00
Miss Islington (bot) 7767534df9
[3.13] gh-122088: Copy the coroutine status of the underlying callable in `@warnings.deprecated` (GH-122086) (#122156)
Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-23 10:24:07 +00:00
Miss Islington (bot) 48154e7053
[3.13] gh-120974: Make _asyncio._enter_task atomic in the free-threaded build (GH-122138) (#122152)
gh-120974: Make _asyncio._enter_task atomic in the free-threaded build (GH-122138)

Use `PyDict_SetDefaultRef` to set the current task in a single operation
under the dictionary's lock.
(cherry picked from commit 47847aa8ef)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-23 09:17:52 +00:00
Miss Islington (bot) 4892cc072a
[3.13] Refactor test_capi.test_long (GH-122113) (GH-122137)
Share common code for tests for PyLong_As*() functions.
(cherry picked from commit 69f2dc5c06)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-23 10:01:13 +03:00
Miss Islington (bot) e175bd3aaf
[3.13] Revert "gh-121946: Temporarily switch to llvm-17 in TSan CI (GH-121975)" (GH-122032) (#122131)
This reverts commit 53774e911d.

The LLVM 18 Ubuntu package is working now.
(cherry picked from commit ad935a9016)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-22 17:57:36 +00:00
Miss Islington (bot) f00ba7335a
[3.13] gh-99242 Ignore error when running regression tests under certain conditions. (GH-121663) (GH-121669)
(cherry picked from commit 0759cecd9d)

Co-authored-by: Bas Bloemsaat <bas@bloemsaat.com>
Co-authored-by: Kevin Diem <kg.diem@gmail.com>
2024-07-22 14:53:46 +02:00
Miss Islington (bot) 148beb6de9
[3.13] gh-121957: Emit audit events for `python -i` and `python -m asyncio` (GH-121958) (GH-122115)
Relatedly, emit the `cpython.run_startup` event from the Python version of
`PYTHONSTARTUP` handling.
(cherry picked from commit dc93d1125f)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-07-22 13:36:57 +02:00
Jakub Kulík 82db81528c
[3.13] gh-118124: fix assert related C++ checks on Solaris/Illumos (GH-121974) (#122108)
Fix check for static_assert() for C++ on some platforms..
(cherry picked from commit e88bd96d0d)
2024-07-22 07:50:20 +00:00
Miss Islington (bot) 3ae1236c73
[3.13] Docs: spelling and grammar fixes (GH-122084) (#122106)
Docs: spelling and grammar fixes (GH-122084)

Corrected some grammar and spelling issues in documentation.

(cherry picked from commit bc264eac3a)

Co-authored-by: Ville Skyttä <ville.skytta@iki.fi>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-07-22 01:30:34 +00:00
Miss Islington (bot) 587a8f84ed
[3.13] gh-120522: Apply App Store compliance patch during installation (GH-121947) (#122105)
gh-120522: Apply App Store compliance patch during installation (GH-121947)

Adds a --with-app-store-compliance configuration option that patches out code known to be an issue with App Store review processes. This option is applied automatically on iOS, and optionally on macOS.
(cherry picked from commit 728432c804)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-07-22 08:13:34 +08:00
Miss Islington (bot) 82b813735f
[3.13] Merge Ubuntu test matrices in CI (GH-121813) (#122098)
Co-authored-by: Sviatoslav Sydorenko (Святослав Сидоренко) <wk.cvs.github@sydorenko.org.ua>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-07-21 19:35:29 +00:00
Miss Islington (bot) e458268143
[3.13] gh-121266: Remove Py_ALWAYS_INLINE in dictobject.c (GH-121493) (#122095)
gh-121266: Remove Py_ALWAYS_INLINE in dictobject.c (GH-121493)

compare_unicode_generic(), compare_unicode_unicode() and
compare_generic() are callbacks used by do_lookup(). When enabling
assertions, it's not possible to inline these functions.
(cherry picked from commit c5a6b9afd8)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-21 17:11:12 +00:00
Miss Islington (bot) 4b76404a51
[3.13] gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391) (#121392)
gh-121390: tracemalloc: Fix tracebacks memory leak (GH-121391)

The tracemalloc_tracebacks hash table has traceback keys and NULL
values, but its destructors do not reflect this -- key_destroy_func is
NULL while value_destroy_func is raw_free. Swap these to free the
traceback keys instead.
(cherry picked from commit db39bc42f9)

Co-authored-by: Josh Brobst <jbrobst@proton.me>
2024-07-21 13:12:13 +00:00
Miss Islington (bot) 66435241d8
[3.13] Delete stale note about mp.Lock.acquire/SIGINT (GH-120929) (GH-122078)
Delete stale note about mp.Lock.acquire/SIGINT (GH-120929)
(cherry picked from commit 0dcbc83853)

Co-authored-by: Andrey Mishchenko <mishchea@gmail.com>
2024-07-21 06:34:36 +00:00
Miss Islington (bot) 774c7b1693
[3.13] gh-121977: Add tips for handling unhashable data (GH-122075) (#122076)
gh-121977: Add tips for handling unhashable data (GH-122075)
(cherry picked from commit ebc18abbf3)

Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
2024-07-21 06:10:06 +00:00
Miss Islington (bot) 7fc1006e31
[3.13] Docs: Fix duplicate object description warnings (GH-122068) (#122069)
Docs: Fix duplicate object description warnings (GH-122068)
(cherry picked from commit 8db5f48007)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-20 20:04:02 +00:00
Miss Islington (bot) 2fff3c44b3
[3.13] gh-121266: Change dict check_lookup() return type to int (GH-121581) (#121949)
gh-121266: Change dict check_lookup() return type to int (GH-121581)
(cherry picked from commit 51da3dfbf3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-07-20 18:57:27 +00:00
Miss Islington (bot) bd5121b1c0
[3.13] gh-121988: Fix test hang when pyrepl is not available (GH-121990) (#122064)
gh-121988: Fix test hang when pyrepl is not available (GH-121990)

Also explicitly fail the test if we timeout while waiting for output so
that this failure mode is caught earlier.
(cherry picked from commit a09e215abf)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-07-20 14:32:41 +00:00
Miss Islington (bot) efc7d1ca86
[3.13] GH-121970: Modernise the patchlevel extension (GH-121995) (#122060)
GH-121970: Modernise the patchlevel extension (GH-121995)
(cherry picked from commit b7ad711fcb)

Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-07-20 14:02:23 +00:00
Miss Islington (bot) 1b4c5fe159
[3.13] Docs: Fix a typo in What's New in Python 3.13 (GH-122051) (#122052)
Docs: Fix a typo in What's New in Python 3.13 (GH-122051)
(cherry picked from commit 3de092b82f)

Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
2024-07-20 04:03:33 +00:00
Sam Gross f3c79cb400
[3.13] gh-121621: Disable asyncio freelist in free-threaded build (GH-122046) (#122048)
The futureobj freelist isn't thread-safe. We intend to re-enable the
freelist in a thread-safe way for 3.14 (but not 3.13).
(cherry picked from commit 97248204a1)
2024-07-19 19:55:15 +00:00