Commit Graph

122248 Commits

Author SHA1 Message Date
Miss Islington (bot) ef9fd10670
[3.13] gh-119538: Add missing expat build dependencies (GH-119647) (#119685)
xmltok_impl.c and xmltok_ns.c are _included_ in xmltok.c by the C
pre-processor.

(cherry picked from commit 606be66362)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-05-28 22:10:59 +00:00
Eric Snow 12a580b82d
[3.13] gh-117398: Statically Allocate the Datetime C-API (GH-119472) (gh-119641)
This is a backport of 3 commits that go together.

(cherry picked from commit a895756)
(cherry picked from commit b30d30c)
(cherry picked from commit a89fc26)
2024-05-28 21:00:04 +00:00
Miss Islington (bot) 0d0be6b3ef
[3.13] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119682)
- Cache line object to avoid creating a Unicode object
  for all of the tokens in the same line.
- Speed up byte offset to column offset conversion by using the
  smallest buffer possible to measure the difference.

(cherry picked from commit d87b015106)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2024-05-28 22:47:45 +02:00
Miss Islington (bot) c0e9961798
[3.13] gh-119011: `type.__type_params__` now return an empty tuple (GH-119296) (#119678)
(cherry picked from commit 6b240c2308)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-28 19:09:04 +00:00
Jelle Zijlstra 6394a72e99
[3.13] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119643)
Fixes #119311. Fixes #119395.

(cherry picked from commit a9a74da4a0)
2024-05-28 11:03:33 -07:00
Miss Islington (bot) 2b46253c5f
[3.13] gh-119581: Add a test of InitVar with name shadowing (GH-119582) (#119672)
gh-119581: Add a test of InitVar with name shadowing (GH-119582)
(cherry picked from commit 6ec371223d)

Co-authored-by: Steven Troxler <steven.troxler@gmail.com>
2024-05-28 17:41:02 +00:00
Miss Islington (bot) cc8586a1ed
[3.13] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409) (GH-119483)
Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)
(cherry picked from commit ffa24aab10)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-05-28 16:55:37 +02:00
Miss Islington (bot) 47fb0f82cd
[3.13] [doc] Clarify the nature of the root logger in the `logging` documentation (GH-119440) (GH-119651)
(cherry picked from commit b407ad38fb)
2024-05-28 15:04:46 +01:00
Miss Islington (bot) dcf585d0c1
[3.13] Re-order imports to align with zipp 3.18.2 (GH-119587) (#119589)
Re-order imports to align with zipp 3.18.2 (GH-119587)
(cherry picked from commit 5482a939ac)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2024-05-28 08:49:13 -04:00
Miss Islington (bot) 3b111a38ea
[3.13] gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861) (#119649)
gh-116860: Remove outdated `test_parserhack` from `test_future` (GH-116861)
(cherry picked from commit 669175bf8e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-28 09:55:37 +00:00
Eric Snow 9216a5336f
[3.13] gh-117398: Revert gh-119636, Add multiphase support to _datetime (#119639)
Revert "[3.13] gh-117398: Add multiphase support to _datetime (gh-119373) (gh-119636)"

This reverts commit d58ebf073c.
2024-05-28 00:52:52 +00:00
Miss Islington (bot) 7322ff1561
[3.13] gh-119317: findall instead of traverse for docutils nodes (GH-119319) (#119486)
gh-119317: findall instead of traverse for docutils nodes (GH-119319)
(cherry picked from commit 0867bce457)

Co-authored-by: Carlos Meza <hire@carlosmeza.com>
2024-05-27 23:46:15 +00:00
Miss Islington (bot) d58ebf073c
[3.13] gh-117398: Add multiphase support to _datetime (gh-119373) (gh-119636)
This is minimal support.  Subinterpreters are not supported yet.  That will be addressed in a later change.

(cherry picked from commit 3e8b60905e)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-05-27 16:36:32 -06:00
Miss Islington (bot) 660125f864
[3.13] gh-119584: Fix test_import Failed Assertion (gh-119623) (gh-119633)
The fix in gh-119561 introduced an assertion that doesn't hold true if any of the three new test extension modules are loaded more than once.  This is fine normally but breaks if the new test_check_state_first() is run more than once, which happens for refleak checking and with the regrtest --forever flag.  We fix that here by clearing each of the three modules after loading them.  We also tweak a check in _modules_by_index_check().

(cherry picked from commit ae7b17673f)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-05-27 20:04:13 +00:00
Miss Islington (bot) bd9983cab8
[3.13] gh-119560: Drop an Invalid Assert in PyState_FindModule() (gh-119561) (gh-119632)
The assertion was added in gh-118532 but was based on the invalid assumption that PyState_FindModule() would only be called with an already-initialized module def.  I've added a test to make sure we don't make that assumption again.

(cherry picked from commit 0c5ebe13e9)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-05-27 19:11:29 +00:00
Hugo van Kemenade 0a4a3184f5
[3.13] Docs: Move inline JavaScript to own file to reduce duplication (GH-119541) (#119630) 2024-05-27 12:49:52 -06:00
Miss Islington (bot) 8117cb5f01
[3.13] Misc cleanups and wording improvements for the itertools docs (gh-119626) (gh-119629) 2024-05-27 13:44:11 -05:00
Miss Islington (bot) 9edf0109eb
[3.13] gh-119580: Improve version added section for convenience variable (GH-119583) (#119624)
Co-authored-by: Tian Gao <gaogaotiantian@hotmail.com>
2024-05-27 18:13:01 +00:00
Miss Islington (bot) ba71835fa5
[3.13] Docs: Only install sphinx-autobuild for `make htmllive` (GH-119607) (#119621)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-27 17:44:55 +00:00
Miss Islington (bot) f1302c1e47
[3.13] gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475) (#119602)
gh-119467: Fix Py_buffer.format type and correct documentation typo (GH-119475)
(cherry picked from commit 3b26cd8ca0)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
2024-05-27 12:34:13 +00:00
Miss Islington (bot) 46d7712829
[3.13] Fix typos in HISTORY documentation (GH-119453) (#119597)
Co-authored-by: Xie Yanbo <xieyanbo@gmail.com>
2024-05-27 08:13:49 +00:00
Miss Islington (bot) 825a5ae5d8
[3.13] gh-111997: Fix argument count for LINE event and clarify type of argument counts. (GH-119179) (GH-119575)
gh-111997: Fix argument count for LINE event and clarify type of argument counts. (GH-119179)
(cherry picked from commit 70b07aa415)

Co-authored-by: scoder <stefan_ml@behnel.de>
2024-05-26 12:59:29 +00:00
Miss Islington (bot) 3f0198d927
[3.13] docs: fix a few typos identified by codespell (GH-119516) (#119570)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2024-05-26 08:20:37 +00:00
Miss Islington (bot) 2404cd9460
[3.13] gh-99180: Make `StackSummary.should_show_carets` private (GH-119554) (#119556)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-05-25 17:30:57 +00:00
Miss Islington (bot) 317cc3bcd2
[3.13] FAQ: Add reference to Python version numbering scheme (GH-119225) (#119544)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-05-25 14:29:47 +00:00
Miss Islington (bot) f49749cf8f
[3.13] gh-111999: Fix the signature of str.format_map() (GH-119540) (#119543)
(cherry picked from commit 08e65430aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-25 13:46:41 +00:00
Raymond Hettinger 5544651350
[3.13] Misc improvement to the docs for itertools (gh-119529) (#119531)
Misc improvement to the docs for itertools (gh-119529)
2024-05-24 17:26:25 -05:00
Miss Islington (bot) 392a3d8ade
[3.13] Regen ``Doc/requirements-oldest-sphinx.txt`` (GH-119520) (#119522)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-05-24 14:01:44 -06:00
Miss Islington (bot) cc38ee1edb
gh-118263: Add additional arguments to path_t (Argument Clinic type) in posixmodule (GH-118355)
(cherry picked from commit 96b392df30)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
2024-05-24 18:26:06 +00:00
Miss Islington (bot) 217d57fc3c
[3.13] GH-119496: accept UTF-8 BOM in .pth files (GH-119508)
`Out-File -Encoding utf8` and similar commands in Windows Powershell 5.1 emit
UTF-8 with a BOM marker, which the regular `utf-8` codec decodes incorrectly.

`utf-8-sig` accepts a BOM, but also works correctly without one.

This change also makes .pth files match the way Python source files are handled.

(cherry picked from commit bf5b6467f8)

Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2024-05-24 14:52:20 +00:00
Miss Islington (bot) 0bab0b3a53
[3.13] gh-69214: Fix fcntl.ioctl() request type (GH-119498) (#119504)
gh-69214: Fix fcntl.ioctl() request type (GH-119498)

Use an 'unsigned long' instead of an 'unsigned int' for the request
parameter of fcntl.ioctl() to support requests larger than UINT_MAX.
(cherry picked from commit 92fab3356f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-05-24 12:54:59 +00:00
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