Commit Graph

122317 Commits

Author SHA1 Message Date
Miss Islington (bot) c864efba25
[3.13] gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216) (#119497)
* gh-118692: Avoid creating unnecessary StopIteration instances for monitoring (GH-119216)
(cherry picked from commit 6e9863d7a3)

---------

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-24 10:18:13 +00:00
Miss Islington (bot) e27e36922e
[3.13] GH-113464: Run the JIT interpreter before any other JIT CI (GH-119490)
(cherry picked from commit b48a3dbff4)
2024-05-24 03:38:56 +00:00
Victor Stinner c750061047
[3.13] gh-119461: Fix ThreadedVSOCKSocketStreamTest (#119465) (#119479)
gh-119461: Fix ThreadedVSOCKSocketStreamTest (#119465)

Fix ThreadedVSOCKSocketStreamTest: if get_cid() returns the host
address or the "any" address, use the local communication address
(loopback): VMADDR_CID_LOCAL.

On Linux 6.9, apparently, the /dev/vsock device is now available but
get_cid() returns VMADDR_CID_ANY (-1).

(cherry picked from commit e94dbe4ed8)
2024-05-23 22:27:04 +00:00
Miss Islington (bot) d98d6b1776
[3.13] gh-118727: Don't drop the GIL in `drop_gil()` unless the current thread holds it (GH-118745) (#119474)
`drop_gil()` assumes that its caller is attached, which means that the current
thread holds the GIL if and only if the GIL is enabled, and the enabled-state
of the GIL won't change. This isn't true, though, because `detach_thread()`
calls `_PyEval_ReleaseLock()` after detaching and
`_PyThreadState_DeleteCurrent()` calls it after removing the current thread
from consideration for stop-the-world requests (effectively detaching it).

Fix this by remembering whether or not a thread acquired the GIL when it last
attached, in `PyThreadState._status.holds_gil`, and check this in `drop_gil()`
instead of `gil->enabled`.

This fixes a crash in `test_multiprocessing_pool_circular_import()`, so I've
reenabled it.
(cherry picked from commit be1dfccdf2)

Co-authored-by: Brett Simmers <swtaarrs@users.noreply.github.com>
2024-05-23 21:27:38 +00:00
Miss Islington (bot) 8fd8cc564b
[3.13] gh-119469: Fix _pyrepl reference leaks (GH-119470) (#119471)
(cherry picked from commit 6e012ced6c)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-23 19:58:59 +02:00
Miss Islington (bot) 251ef2e36f
[3.13] GH-117195: Avoid assertion error in `object.__sizeof__` (GH-117220) (GH-119456) 2024-05-23 16:58:34 +01:00
Miss Islington (bot) dbe4f8a2e8
[3.13] Fix typos in what's new documentation (GH-119448) (#119449) 2024-05-23 06:59:33 +00:00
Miss Islington (bot) 89e2689545
[3.13] gh-90562: Mention slots pitfall in dataclass docs (GH-107391) (#119350)
Co-authored-by: Josh Cannon <joshdcannon@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-23 00:16:19 -06:00
Miss Islington (bot) 58dbb4a4b0
[3.13] gh-111201: Speed up paste mode in the REPL (#119341) (GH-119432) (#119439)
(cherry picked from commit e6572e8f98)

Also includes:

* gh-111201: Use calc_complete_screen after bracketed paste in PyREPL (GH-119432)
(cherry picked from commit 14b063cbf1)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2024-05-23 04:23:40 +00:00
Lysandros Nikolaou 9fa1b4fc46
[3.13] gh-118911: Trailing whitespace in a block shouldn't prevent the user from terminating the code block (GH-119355) (#119404)
(cherry picked from commit 5091c4400c)

Co-authored-by: Aya Elsayed <ayah.ehab11@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-23 00:12:26 -04:00
Miss Islington (bot) dbff1f1077
[3.13] gh-119434: Fix culmitive errors in wrapping as lines proceed (GH-119435) (#119441)
Fix culmitive errors in wrapping as lines proceed
(cherry picked from commit e3bf5381fd)

Co-authored-by: Dino Viehland <dinoviehland@gmail.com>
2024-05-22 23:46:11 -04:00
Miss Islington (bot) cd35e9d85a
[3.13] gh-117657: Fix missing atomic in dict_resize (GH-119312) (#119417)
gh-117657: Fix missing atomic in dict_resize (GH-119312)

Fix missing atomic in dict_resize
(cherry picked from commit 2b3fb767be)

Co-authored-by: Dino Viehland <dinoviehland@meta.com>
2024-05-22 14:42:47 -07:00
Miss Islington (bot) a6ed7425d8
[3.13] gh-70795: Rework RLock documentation (GH-103853) (#119436)
gh-70795: Rework RLock documentation (GH-103853)

Attempted to simultaneously reduce verbosity, while more descriptively
describing behavior.

Fix links (RLock acquire/release previously linking to Lock
acquire/release, seems like bad copy pasta).

Add a seealso for with-locks.

Switch section to use bullet points.

---------

(cherry picked from commit 2fbea81d64)

Co-authored-by: uıɐɾ ʞ ʇɐɯɐs <_@skj.io>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2024-05-22 14:21:58 -07:00
Lysandros Nikolaou 9435124d4a
[3.13] gh-111201: auto-indentation in _pyrepl (GH-119348) (#119427)
(cherry picked from commit cd516cd1f5)

Co-authored-by: Arnon Yaari <wiggin15@yahoo.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 23:14:03 +02:00
Miss Islington (bot) 81440c5ba1
[3.13] Enable some stricter mypy settings on `Lib/_pyrepl` (GH-119077) (#119428)
(cherry picked from commit 0883fd22e6)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-22 23:13:47 +02:00
Miss Islington (bot) 6bc7fc08ae
[3.13] gh-113978: Ignore warnings on text completion inside REPL (GH-113979) (#119429)
(cherry picked from commit e03dde5a24)

Co-authored-by: Yan Yanchii <yyanchiy@gmail.com>
2024-05-22 23:13:32 +02:00
Lysandros Nikolaou e6e4efcc86
[3.13] gh-119357: Increase test coverage for keymap in _pyrepl (GH-119358) (#119414)
(cherry picked from commit 73ab83b27f)

Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 23:13:01 +02:00
Miss Islington (bot) 3e30a38561
gh-117505: Run ensurepip in isolated env in Windows installer (GH-118257)
ensurepip forks a subprocess to run pip itself, but that subprocess only inherits a -I isolated mode flag (see _run_pip() in Lib/ensurepip/__init__.py), not the "-E -s" flags that the installer has been using. This means that parts of ensurepip don't actually run in an isolated environment and can make incorrect decisions based on packages installed in the user site-packages.
(cherry picked from commit c9073eb1a9)

Co-authored-by: Michael Vincent <377567+Vynce@users.noreply.github.com>
2024-05-22 19:46:35 +00:00
Miss Islington (bot) 0bd7c879cf
[3.13] gh-112066: Fix versionadded in PyDict_SetDefaultRef docs (GH-118696) (#119430)
(cherry picked from commit 447edb6e98)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2024-05-22 15:36:35 -04:00
Miss Islington (bot) 08416065a7
[3.13] gh-119247: Add macros to use PySequence_Fast safely in free-threaded build (GH-119315) (#119419)
Add `Py_BEGIN_CRITICAL_SECTION_SEQUENCE_FAST` and
`Py_END_CRITICAL_SECTION_SEQUENCE_FAST` macros and update `str.join` to use
them. Also add a regression test that would crash reliably without this
patch.
(cherry picked from commit baf347d916)

Co-authored-by: Josh {*()} Rosenberg <26495692+MojoVampire@users.noreply.github.com>
2024-05-22 19:24:02 +00:00
Miss Islington (bot) cd39da75af
[3.13] Improve `pyrepl` type-annotation coverage (GH-119081) (#119415)
(cherry picked from commit 033f5c87f1)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-22 18:38:32 +00:00
Miss Islington (bot) bfd9c3ea53
[3.13] gh-119213: Be More Careful About _PyArg_Parser.kwtuple Across Interpreters (gh-119331) (gh-119410)
_PyArg_Parser holds static global data generated for modules by Argument Clinic.  The _PyArg_Parser.kwtuple field is a tuple object, even though it's stored within a static global.  In some cases the tuple is statically allocated and thus it's okay that it gets shared by multiple interpreters.  However, in other cases the tuple is set lazily, allocated from the heap using the active interprepreter at the point the tuple is needed.

This is a problem once that interpreter is destroyed since _PyArg_Parser.kwtuple becomes at dangling pointer, leading to crashes.  It isn't a problem if the tuple is allocated under the main interpreter, since its lifetime is bound to the lifetime of the runtime.  The solution here is to temporarily switch to the main interpreter.  The alternative would be to always statically allocate the tuple.

This change also fixes a bug where only the most recent parser was added to the global linked list.

(cherry picked from commit 81865002ae)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-05-22 12:09:48 -06:00
Miss Islington (bot) a463cd8e45
[3.13] gh-118893: Evaluate all statements in the new REPL separately (GH-119318) (#119408)
(cherry picked from commit a3e4fec873)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 16:22:01 +00:00
Miss Islington (bot) eafd633fac
[3.13] gh-119205: Fix autocompletion bug in new repl (GH-119229) (#119407)
(cherry picked from commit 506b1a3ff6)

Co-authored-by: Koudai Aono <koxudaxi@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 16:07:38 +00:00
Miss Islington (bot) aefe2e626e
[3.13] gh-111201: Add append to screen method to avoid recalculation (GH-119274) (#119405)
(cherry picked from commit c886bece3b)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2024-05-22 16:03:04 +00:00
Lysandros Nikolaou ac9163637b
[3.13] gh-111201: Remove readline dependency from the PyREPL (GH-119262) (#119403)
(cherry picked from commit 561ff1fa71)
2024-05-22 11:45:11 -04:00
Lysandros Nikolaou 721459831a
[3.13] gh-119306: Break up _pyrepl tests (GH-119307) (#119362)
(cherry picked from commit f49df4f486)

Co-authored-by: Eugene Triguba <eugenetriguba@gmail.com>
2024-05-22 11:02:18 -04:00
Miss Islington (bot) 6892b400dc
[3.13] gh-118643: Fix AttributeError in the email module (GH-119099) (GH-119389)
Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.

Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
(cherry picked from commit 858b9e85fc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-22 14:07:38 +03:00
Miss Islington (bot) 414346e56d
[3.13] Fix version number in use_load_tests deprecation reference (GH-119151) (GH-119386)
Deprecation took place in d78742a260 (3.5)
(cherry picked from commit aee8f03abb)

Co-authored-by: Jacob Walls <jacobtylerwalls@gmail.com>
2024-05-22 09:58:59 +00:00
Miss Islington (bot) 0e6198972a
[3.13] Fix typos in NEWS entries for 3.13 (GH-119374) (GH-119385)
(cherry picked from commit 904e256292)

Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-22 09:47:49 +00:00
Miss Islington (bot) ec484b6862
[3.13] gh-119189: Add yet more tests for mixed Fraction arithmetic (GH-119298) (GH-119346)
(cherry picked from commit 10b1bd926a)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-22 09:37:07 +00:00
Miss Islington (bot) f757996942
[3.13] Clarify that dklen is expected in bytes for the hashlib functions (GH-106624) (GH-119383)
(cherry picked from commit 5adf78f546)

Co-authored-by: Mathijs Mortimer <thiezn@users.noreply.github.com>
2024-05-22 09:10:02 +00:00
Miss Islington (bot) b5b0e3210d
[3.13] DOCS: fix error in exec namespace note (gh-119380)
When updating the new exec note added in gh-119235 as part of the
PEP 667 general docs PR, I suggested a workaround that isn't valid.

The first half of the note is still reasonable, so just omit the invalid text.

(cherry picked from commit 31d61a75c9)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-05-22 06:58:36 +00:00
Miss Islington (bot) 455b386234
[3.13] gh-110383: Align dict.get(), .fromkeys(), and .setdefault() docs with docstrings (GH-119330) (#119370)
(cherry picked from commit 0e3c8cda1f)

Co-authored-by: Landon Wood <landon@elkrange.com>
2024-05-22 01:31:56 +00:00
Miss Islington (bot) e992217810
[3.13] gh-118877: Fix AssertionError crash in pyrepl (GH-118936) (#119363)
(cherry picked from commit c0d81b2566)

Co-authored-by: Daniel Hollas <daniel.hollas@bristol.ac.uk>
2024-05-22 01:28:24 +00:00
Miss Islington (bot) f15fbe9991
gh-118507 : Refactor `nt._path_is*` to improve applicability for other cases (GH-118755)
(cherry picked from commit b64182550f)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-05-22 00:29:34 +00:00
Miss Islington (bot) f371565169
[3.13] gh-119102: Fix REPL for dumb terminal (GH-119332) (#119359)
The site module gets the __main__ module to get _pyrepl.__main__.
(cherry picked from commit de8f530841)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-05-22 00:14:44 +00:00
Miss Islington (bot) 05820164ce
[3.13] Docs: Add central references to free-threading-related options (GH-119017) (#119367)
Docs: Add central references to free-threading-related options (GH-119017)
(cherry picked from commit 9fa206aaec)

Co-authored-by: Brett Simmers <swtaarrs@users.noreply.github.com>
2024-05-21 23:16:59 +00:00
Miss Islington (bot) fef202f97b
[3.13] Fix typos in documentation (GH-119295) (#119337)
Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-21 22:07:20 +00:00
Miss Islington (bot) 8860f83e4b
[3.13] gh-119035: Add Ctrl+← and Ctrl+→ word-skipping keybindings to new repl (GH-119248) (#119323)
add word-skipping ctrl keybindings to new repl
(cherry picked from commit 0398d93392)

Co-authored-by: Alastair Stanley <alastairstanley@ntlworld.com>
2024-05-21 17:16:06 -04:00
Miss Islington (bot) 256b791fd6
[3.13] gh-110383: Document `socket.makefile()` accepts combined modes (GH-119150) (#119324)
The supported mode values are 'r', 'w', and 'b', or a combination of those.
(cherry picked from commit 62a29be5bb)

Co-authored-by: Daniel Williams <dann0a@gmail.com>
2024-05-21 18:44:53 +00:00
Miss Islington (bot) 11ca1d9d53
[3.13] GH-110383: Improve Tutorial for Input Ouput (GH-119230) (GH-119326)
GH-110383: Improve Tutorial for Input Ouput (GH-119230)

(cherry picked from commit 9db2fd7eda)

Co-authored-by: Blaise Pabon <blaise@gmail.com>
Co-authored-by: edson duarte <eduarte.uatach@gmail.com>
2024-05-21 19:54:26 +02:00
Miss Islington (bot) d93c4f9b1c
[3.13] GH-119292: Add job to JIT CI to build and test with --disable-gil (GH-119314)
(cherry picked from commit c4722cd057)
Co-authored-by: Savannah Ostrowski <savannahostrowski@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-21 16:17:49 +00:00
Miss Islington (bot) dcb8030c53
[3.13] gh-119053: Implement the fast path for list.__getitem__ (gh-119112) (gh-119309)
gh-119053: Implement the fast path for list.__getitem__ (gh-119112)
(cherry picked from commit ab4263a82a)

Co-authored-by: Donghee Na <donghee.na@python.org>
2024-05-21 14:42:22 +00:00
Hugo van Kemenade 1929b7e2bf
[3.13] Docs: Ensure no warnings are found in the NEWS file before a given line number (GH-119221) (#119261) 2024-05-21 08:40:08 -06:00
Miss Islington (bot) f028451d95
[3.13] gh-119102: Fix REPL for dumb terminal (GH-119269) (#119308)
gh-119102: Fix REPL for dumb terminal (GH-119269)

Use CAN_USE_PYREPL of _pyrepl.__main__ in the site module to decide
if _pyrepl.write_history_file() can be used.
(cherry picked from commit 73f4a58d36)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-05-21 13:46:11 +00:00
Miss Islington (bot) 49ad4d077f
[3.13] Use `fail-fast: false` in `mypy.yml` (GH-119297) (#119304)
Use `fail-fast: false` in `mypy.yml` (GH-119297)

See docs about this setting: https://docs.github.com/en/actions/using-workflows/workflow-syntax-for-github-actionsGH-jobsjob_idstrategyfail-fast
(cherry picked from commit b365332906)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-21 12:47:00 +00:00
Miss Islington (bot) db64dae745
[3.13] gh-74929: PEP 667 general docs update (gh-119291)
* expand on What's New entry for PEP 667 (including porting notes)
* define 'optimized scope' as a glossary term
* cover comprehensions and generator expressions in locals() docs
* review all mentions of "locals" in documentation (updating if needed)
* review all mentions of "f_locals" in documentation (updating if needed)

(cherry picked from commit e870c852c0)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
2024-05-21 21:35:26 +10:00
Miss Islington (bot) f7303cd967
[3.13] gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (GH-119175) (#119289)
gh-119174: Fix high DPI causes turtledemo(turtle-graphics examples) windows blurry (GH-119175)

------

(cherry picked from commit 538ed5e481)

Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>
2024-05-21 03:53:29 +00:00
Miss Islington (bot) 24b0e8ddb4
[3.13] gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (GH-119232) (#119284)
gh-118912: Remove description of issue fixed in 3.5 from autospeccing guide (GH-119232)

* Remove description of issue fixed in 3.5 from autospeccing guide

* Make autospeccing note text more succint and lint whitespace

* Add linting changes (missed in last commit)

---------

(cherry picked from commit 7e57640c7e)

Co-authored-by: Shauna <shaunagm@gmail.com>
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
2024-05-20 23:50:23 +00:00