Commit Graph

122484 Commits

Author SHA1 Message Date
Miss Islington (bot) 732c00550f
[3.13] gh-119614: Fix truncation of strings with embedded null characters in Tkinter (GH-120909) (GH-120938)
Now the null character is always represented as \xc0\x80 for
Tcl_NewStringObj().
(cherry picked from commit c38e2f64d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-24 09:45:45 +00:00
Miss Islington (bot) 206028dba9
[3.13] gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (GH-112191) (#120935)
gh-112169: Documented getaddrinfo/getnameinfo default loop executor usage and implications. (GH-112191)
(cherry picked from commit fc297b4ba4)

Co-authored-by: Alek Kowalczyk <alek.kowalczyk@gmail.com>
Co-authored-by: Guido van Rossum <gvanrossum@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-06-24 08:55:28 +00:00
Miss Islington (bot) 544a47212b
[3.13] gh-120683: Fix an error in logging.LogRecord timestamp (GH-120709) (GH-120933)
The integer part of the timestamp can be rounded up, while the millisecond
calculation truncates, causing the log timestamp to be wrong by up to 999 ms
(affected roughly 1 in 8 million timestamps).
(cherry picked from commit 1500a23f33)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-24 07:14:26 +00:00
Tian Gao b7240ed3f0
[3.13] gh-119824: Revert the `where` solution and use meta commands (#120919) 2024-06-23 14:11:55 -07:00
Miss Islington (bot) 1aadb51838
[3.13] Docs makefile/RTD: Use uv if installed (GH-120711) (#120922)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-23 19:48:42 +00:00
Miss Islington (bot) 6be1048e27
[3.13] gh-120910: Fix issue resolving relative paths outside site-packages. (GH-120911) (#120917)
gh-120910: Fix issue resolving relative paths outside site-packages. (GH-120911)

Incorporates changes from importlib_metadata 7.2.1.
(cherry picked from commit 1ba0bb21ed)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-06-23 17:30:08 +00:00
Miss Islington (bot) d6791cd933
[3.13] Typing docs: normalize some indents in code examples (GH-120912) (#120915)
Co-authored-by: Nyakku Shigure <sigure.qaq@gmail.com>
2024-06-23 16:31:40 +00:00
Miss Islington (bot) 99f18ea689
[3.13] gh-101830: Fix Tcl_Obj to string conversion (GH-120884) (GH-120905)
Accessing the Tkinter object's string representation no longer converts
the underlying Tcl object to a string on Windows.
(cherry picked from commit f4ddaa3967)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-23 18:33:19 +03:00
Miss Islington (bot) 97acd29541
[3.13] gh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (GH-120898) (#120902)
gh-120896: Fix typo in version changed note of `urllib.parse.urlparse()` (GH-120898)
(cherry picked from commit b6fa8fe86a)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-23 18:28:06 +05:30
Miss Islington (bot) bf7aac3d25
[3.13] gh-119003: Clarify slice assignments (GH-119935) (#120847)
gh-119003: Clarify slice assignments (GH-119935)
(cherry picked from commit 462832041e)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-23 18:04:48 +05:30
Nice Zombies 41b2d19912
[3.13] Amend categories of @nineteendo's news entries (GH-120735) (#120850) 2024-06-22 15:05:15 -05:00
Miss Islington (bot) cffead81fa
[3.13] gh-120873: Add tests for new widget options in Tk 8.7 (GH-120877) (GH-120879)
(cherry picked from commit a046c848c1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-22 13:43:30 +00:00
Miss Islington (bot) 61e6b6ab4a
[3.13] gh-120873: Add test for "state" option in ttk.Scale (GH-120874) (GH-120875)
Also refactor the "state" option tests for other ttk widgets.
(cherry picked from commit 974a978631)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-22 11:45:19 +00:00
Miss Islington (bot) a860b1d60b
[3.13] gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812) (#120843)
gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812)
(cherry picked from commit aed31beca9)

Co-authored-by: Peter <zintensitydev@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-06-22 16:44:46 +05:30
Miss Islington (bot) 4fabbf9773
[3.13] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120864)
The tests are now passed with the current version of Tcl/Tk under
development (8.7b1+ and 9.0b3+).

The following changes were also made to make the tests more flexible:

* Helper methods like checkParam() now interpret the expected error message
  as a regular expression instead of a literal.
* Add support of new arguments in checkEnumParam():
  - allow_empty=True skips testing with empty string;
  - fullname= specifies the name for error message if it differs from the
    option name;
  - sort=True sorts values for error message.
* Add support of the allow_empty argument in checkReliefParam():
  allow_empty=True adds an empty string to the list of accepted values.
* Attributes _clip_highlightthickness, _clip_pad and  _clip_borderwidth
  specify how negative values of options -highlightthickness, -padx, -pady
  and -borderwidth are handled.
* Use global variables for some common error messages.

(cherry picked from commit 6ad26de6e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-22 07:17:55 +00:00
Sam Gross 4dc27bc0b7
[3.13] gh-119344: Make critical section API public (GH-119353) (#120856)
This makes the following macros public as part of the non-limited C-API for
locking a single object or two objects at once.

* `Py_BEGIN_CRITICAL_SECTION(op)` / `Py_END_CRITICAL_SECTION()`
* `Py_BEGIN_CRITICAL_SECTION2(a, b)` / `Py_END_CRITICAL_SECTION2()`

The supporting functions and structs used by the macros are also exposed for
cases where C macros are not available.
(cherry picked from commit 8f17d69b7b)
2024-06-21 20:20:41 +00:00
Miss Islington (bot) e748805f2a
[3.13] gh-120838: Add a Note in the Docs About Expectations for Py_Finalize() (gh-120852)
(cherry picked from commit 03fa2df927, AKA gh-120839)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-21 19:21:47 +00:00
Miss Islington (bot) abdbf337d4
[3.13] gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778) (#120827)
gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778)
(cherry picked from commit 83d3d7aace)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-21 16:58:46 +05:30
Miss Islington (bot) f3d7823ede
[3.13] gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442) (#120826)
gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442)
(cherry picked from commit 8334a1b55c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-21 11:16:24 +00:00
Miss Islington (bot) 730285519e
[3.13] gh-111259: Document idiomatic RE pattern (?s:.) that matches any character (GH-120745) (GH-120813)
(cherry picked from commit a2f6f7dd26)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-20 21:22:45 +00:00
Sam Gross 3cb6c4cd60
[3.13] gh-117511: Make PyMutex public in the non-limited API (GH-117731) (#120800)
(cherry picked from commit 3af7263037)
2024-06-20 16:00:25 +00:00
Ken Jin 7c7aa5a99c
[3.13] gh-119258: Backport optimizer frame fixes in GH-119365 (GH-120699)
(cherry picked from commit 55402d3)
2024-06-20 23:55:20 +08:00
Mark Shannon b8fd80f91b
[3.13] GH-119462: Enforce invariants of type versioning. Backport of GH-120731. (#120748)
* Remove uses of Py_TPFLAGS_VALID_VERSION_TAG
2024-06-20 15:09:32 +01:00
Miss Islington (bot) d0a5e40f01
[3.13] Update the documentation howto index page and group docs into 3 logical sections (GH-119366, GH-120703) (GH-120646)
Update the documentation howto index page and group docs into 3 logical sections (GH-119366)

(cherry picked from commit a26d27e7ee)

Includes a follow-up fix to properly merge GH-119877:
* Add a link to free-threading HOWTO to the index (GH-120703)
  (cherry picked from commit 45d5cab533)

Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-06-20 10:24:14 +00:00
Jelle Zijlstra 8cfd005b6d
[3.13] gh-119698: fix `symtable.Class.get_methods` and document its behaviour correctly (GH-120151) (#120777)
(cherry picked from commit b8a8e04fec)


Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 22:27:23 -07:00
Miss Islington (bot) 5d194902cb
[3.13] Fix typos in comments (GH-120481) (#120774)
(cherry picked from commit 656a1c8108)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-06-20 03:40:54 +00:00
Miss Islington (bot) 6b714d545f
[3.13] GH-120602: Support LLVM_VERSION_SUFFIX for JIT builds (GH-120768)
(cherry picked from commit 285f42c850)

Co-authored-by: Xarblu <xarblu@protonmail.com>
2024-06-20 01:13:23 +00:00
Miss Islington (bot) e415d2561b
[3.13] gh-118820: Zero-valued flag enum has no name (GH-118848) (GH-120759)
gh-118820: Zero-valued flag enum has no name (GH-118848)
(cherry picked from commit ed5ae6c4d7)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 15:11:30 -07:00
Miss Islington (bot) 355d928e55
[3.13] gh-120732: Fix `name` passing to `Mock`, when using kwargs to `create_autospec` (GH-120737) (#120760)
gh-120732: Fix `name` passing to `Mock`, when using kwargs to `create_autospec` (GH-120737)
(cherry picked from commit 1e4815692f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-19 20:59:28 +00:00
Miss Islington (bot) d3918eb89a
[3.13] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-120753) (#120757)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-19 20:10:33 +00:00
Miss Islington (bot) adef569278
[3.13] gh-120521: clarify except* documentation to allow tuples (GH-120523) (#120750)
(cherry picked from commit 58b3f11176)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-19 12:07:04 -07:00
Nadeshiko Manju ae04b6f636
[3.13] gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in gh-118322 (GH-120712) (#120747)
[3.13] gh-120437: Fix `_CHECK_STACK_SPACE` optimization problems introduced in gh-118322 (GH-120712)

Signed-off-by: Manjusaka <me@manjusaka.me>
Co-authored-by: Ken Jin <kenjin4096@gmail.com>
2024-06-20 01:40:48 +08:00
Miss Islington (bot) bb5d19440b
[3.13] gh-120635: Avoid leaking processes in test_pyrepl (GH-120676) (#120741)
gh-120635: Avoid leaking processes in test_pyrepl (GH-120676)

If the child process takes longer than SHORT_TIMEOUT seconds to
complete, kill the process but then wait until it completes with no
timeout to not leak child processes.
(cherry picked from commit 0f3e36454d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-19 13:38:37 +00:00
Miss Islington (bot) 4ce1246a99
[3.13] gh-120722: Set position on RETURN_VALUE in lambda (GH-120724) (#120738)
(cherry picked from commit d8f27cb114)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2024-06-19 13:22:21 +00:00
Miss Islington (bot) c598e61a22
[3.13] gh-119960: Add information about regex flags in re module functions (GH-119978) (#120730)
gh-119960: Add information about regex flags in re module functions (GH-119978)
(cherry picked from commit a86e6255c3)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
2024-06-19 16:00:34 +05:30
Miss Islington (bot) 071b66b218
[3.13] gh-120726: Fix compiler warnings on is_core_module() (GH-120727) (#120729)
gh-120726: Fix compiler warnings on is_core_module() (GH-120727)

Fix compiler warnings on is_core_module() and
check_interpreter_whence(): only define them when
assertions are built.
(cherry picked from commit a816cd67f4)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-19 10:23:28 +00:00
Miss Islington (bot) 9be94f9ce6
[3.13] gh-119506: fix `_io.TextIOWrapper.write()` write during flush (GH-119507) (#119964)
gh-119506: fix `_io.TextIOWrapper.write()` write during flush (GH-119507)
(cherry picked from commit 52586f930f)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2024-06-19 10:11:07 +00:00
Miss Islington (bot) d65e145f9d
[3.13] gh-120449: fix ``test_pyclbr`` introspection for mangled names (GH-120450) (GH-120700)
gh-120449: fix ``test_pyclbr`` introspection for mangled names (GH-120450)
(cherry picked from commit d8cd0fa4e3)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 09:20:09 +02:00
Miss Islington (bot) 39c3f11f25
[3.13] gh-120381: Fix inspect.ismethoddescriptor() (GH-120684)
The `inspect.ismethoddescriptor()` function did not check for the lack of
`__delete__()` and, consequently, erroneously returned True when applied
to *data* descriptors with only `__get__()` and `__delete__()` defined.

(cherry picked from commit dacc5ac71a)

Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-06-19 17:01:09 +10:00
Miss Islington (bot) a22eb2f266
[3.13] gh-120633: Move scrollbar and remove tear-off menus in turtledemo (GH-120634) (#120725)
gh-120633: Move scrollbar and remove tear-off menus in turtledemo (GH-120634)
(cherry picked from commit 89f7208f67)

Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-19 06:46:13 +00:00
Miss Islington (bot) 1b028117d1
[3.13] gh-120496: Add a note about iterator thread-safe (gh-120685) (#120706)
gh-120496: Add a note about iterator thread-safe (gh-120685)
(cherry picked from commit 7e189aed64)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-06-19 13:15:44 +09:00
Miss Islington (bot) 50fa775e68
[3.13] gh-120367: fix bug where compiler detects redundant jump after pseudo op replacement (GH-120714) (#120716) 2024-06-18 22:34:07 +00:00
Miss Islington (bot) 07145ddf19
[3.13] gh-117953: Skip `test_interpreters` properly without GIL (gh-120707)
(cherry picked from commit 1035fe0cfb, AKA gh-120689)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-18 16:05:30 +00:00
Miss Islington (bot) 1ce5984961
[3.13] gh-118789: Add `PyUnstable_Object_ClearWeakRefsNoCallbacks` (GH-118807) (#120695)
This exposes `PyUnstable_Object_ClearWeakRefsNoCallbacks` as an unstable
C-API function to provide a thread-safe mechanism for clearing weakrefs
without executing callbacks.

Some C-API extensions need to clear weakrefs without calling callbacks,
such as after running finalizers like we do in subtype_dealloc.
Previously they could use `_PyWeakref_ClearRef` on each weakref, but
that's not thread-safe in the free-threaded build.

(cherry picked from commit e8752d7b80)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-06-18 14:54:51 +00:00
Miss Islington (bot) 4f4973d740
[3.13] gh-120659: Skip `test_freethreading` with GIL (GH-120660) (#120694)
gh-120659: Skip `test_freethreading` with GIL (GH-120660)
(cherry picked from commit 360f14a493)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-06-18 14:46:29 +00:00
Miss Islington (bot) 8c129d99ef
[3.13] gh-119241: Add HOWTO for free-threaded C API extensions (GH-119877) (#120693)
Some sections adapted from https://github.com/Quansight-Labs/free-threaded-compatibility/
written by Nathan Goldbaum.

(cherry picked from commit 02b272b702)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Nathan Goldbaum <nathan.goldbaum@gmail.com>
2024-06-18 14:28:51 +00:00
Miss Islington (bot) 36b0052cb2
[3.13] gh-120662: Improve `smtplib` example (GH-120668) (#120681)
gh-120662: Improve `smtplib` example (GH-120668)
(cherry picked from commit 4bc27abdbe)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-18 12:12:58 +00:00
Miss Islington (bot) 692874cdcc
[3.13] gh-119897: Add test for lambda generator invocation (GH-120658) (#120673)
gh-119897: Add test for lambda generator invocation (GH-120658)
(cherry picked from commit 73dc1c678e)


gh-120467: Add test for lambda generator invocation

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-18 10:16:42 +00:00
Miss Islington (bot) 451cb71cc8
[3.13] gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615) (GH-120669)
Mocking only works if sys.modules['pydoc'] and pydoc are the same,
but some pydoc functions reload the module and change sys.modules.
Ensure that sys.modules['pydoc'] is always restored after the corresponding
tests.
(cherry picked from commit 2cf47389e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-18 09:54:55 +00:00
Miss Islington (bot) 71ad34d219
[3.13] gh-120524: Avoid a Race On _PyRuntime.types.managed_static.types[i].interp_count (gh-120657)
gh-120182 added new global state (interp_count), but didn't add thread-safety for it.  This change eliminates the possible race.

(cherry picked from commit 2c66318cdc, AKA gh-120529)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-17 16:13:40 -06:00