gh-123309: Add more tests for the pickletools module (GH-123355)
Add tests for genops() and dis().
(cherry picked from commit e5a567b0a7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-108172: do not override OS preferred browser if it is a super-string of a known browser (GH-113011)
When checking if the registering browser is the "OS preferred browser", do not use a substring search - that makes no sense: one can have a preferred browser that looks like a super-string of a known browser, e.g. "firefox-nightly" vs "firefox".
https://github.com/python/cpython/issues/108172 explains in more detail, and lays out a potential better future enhancement for this case of just using xdg-open. We'll go with this for now.
---------
(cherry picked from commit 10bf615bab)
Co-authored-by: Oded Arbel <oded@geek.co.il>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-120426: Reword the glossary term "immortal" (GH-123191)
Reword the glossary term "immortal", mark it as an implementation detail
(cherry picked from commit 6754566a51)
gh-123431: Harmonize extension code checks in pickle (GH-123434)
This checks are redundant in normal circumstances and can only work if
the extension registry was intentionally broken.
* The Python implementation now raises exception for the extension code
with false boolean value.
* Simplify the C code. RuntimeError is now raised in explicit checks.
* Add many tests.
(cherry picked from commit 0c3ea30238)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-120226: Fix test_sendfile_close_peer_in_the_middle_of_receiving on Linux >= 6.10 (GH-120227)
The worst case is that the kernel buffers 17 pages with a page size of 64k.
(cherry picked from commit a758424566)
Co-authored-by: Xi Ruoyao <xry111@xry111.site>
gh-123270: Replaced SanitizedNames with a more surgical fix. (GH-123354)
Applies changes from zipp 3.20.1 and jaraco/zippGH-124
(cherry picked from commit 2231286d78)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
gh-123213: Fixed xml.etree.ElementTree.Element.extend and assignment to no longer hide exceptions (GH-123214)
(cherry picked from commit 90b6d0e0f8)
Co-authored-by: Bar Harel <bharel@barharel.com>
gh-85110: Preserve relative path in URL without netloc in urllib.parse.urlunsplit() (GH-123179)
(cherry picked from commit 90c892efea)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-122981: Fix inspect.getsource() for generated classes with Python base classes (GH-123001)
Look up __firstlineno__ only in the class' dict, without searching in
base classes.
(cherry picked from commit f88c14d412)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Parameters after the var-positional parameter are now keyword-only
instead of positional-or-keyword.
* Correctly calculate min_kw_only.
* Raise errors for invalid combinations of the var-positional parameter
with "*", "/" and deprecation markers.
(cherry picked from commit 8393608dd9)
gh-122798: Make tests for warnings in the re module more strict (GH-122799)
* Test warning messages.
* Test stack level for re.compile() and re.findall().
(cherry picked from commit d2e5be1f39)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-100256: Skip inaccessible registry keys in the WinAPI mimetype implementation (GH-122047)
(cherry picked from commit 0bd93755f3)
Co-authored-by: Lucas Esposito <LucasEsposito@users.noreply.github.com>
gh-121151: argparse: Fix wrapping of long usage text of arguments inside a mutually exclusive groups (GH-121159)
(cherry picked from commit 013a092975)
Co-authored-by: Ali Hamdan <ali.hamdan.dev@gmail.com>
gh-79846: Make ssl.create_default_context() ignore invalid certificates (GH-91740)
An error in one certificate should not cause the whole thing to fail.
(cherry picked from commit 9e551f9b35)
Co-authored-by: pukkandan <pukkandan.ytdlp@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-122571: Remove duplicate definition of PY_BUILTIN_HASHLIB_HASHES in configure.ac (GH-122572)
The redefinition in confdefs.h can cause issues with the
AX_CHECK_COMPILE_FLAG macro.
(cherry picked from commit b5e142ba7c)
Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
gh-120083: Add IDLE Hovertip foreground color needed for recent macOS (GH-120605)
On recent versions of macOS (sometime between Catalina and Sonoma 14.5), the default Hovertip foreground color changed from black to white, thereby matching the background. This might be a matter of matching the white foreground of the dark-mode text. The unreadable result is shown here (GH-120083 (comment)).
The foreground and background colors were made parameters so we can pass different colors for future additional hovertips in IDLE.
---------
(cherry picked from commit 5a7f7c4864)
Co-authored-by: John Riggles <jriggles@icloud.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-122527: Fix a crash on deallocation of `PyStructSequence` (GH-122577)
The `PyStructSequence` destructor would crash if it was deallocated after
its type's dictionary was cleared by the GC, because it couldn't compute
the "real size" of the instance. This could occur with relatively
straightforward code in the free-threaded build or with a reference
cycle involving the type in the default build, due to differing orders
in which `tp_clear()` was called.
Account for the non-sequence fields in `tp_basicsize` and use that,
along with `Py_SIZE()`, to compute the "real" size of a
`PyStructSequence` in the dealloc function. This avoids the accesses to
the type's dictionary during dealloc, which were unsafe.
(cherry picked from commit 4b63cd170e)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-91126: Docs and tests for slotted dataclasses with `__init_subclass__` (GH-123342)
(cherry picked from commit 75e72822a3)
Co-authored-by: sobolevn <mail@sobolevn.me>
gh-123494: Improve documentation for ``webbrowser`` return types (GH-123495)
Document the return value for ``webbrowser.open*()``.
(cherry picked from commit 0b6acfee04)
Co-authored-by: Aarni Koskela <akx@iki.fi>
Enable colour for doctest on GitHub Actions (GH-123536)
(cherry picked from commit 0cba289870)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-122136: test_asyncio: Don't fail if the kernel buffers more data than advertised (GH-123423)
(cherry picked from commit b379f1b26c)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-123254: Improve `tuple` C API docs with more info about errors (GH-123255)
(cherry picked from commit 6f563e364d)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Ensure that iOS test re-runs don't try to spawn a process. (GH-122994)
Adds the --single-process option to the iOS test runner to ensure re-runs execute in the same process.
(cherry picked from commit e03073ff20)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Add a --rerun option to the iOS testbed. (GH-122992)
Enable --rerun when running tests on iOS.
(cherry picked from commit ce39d3c6bd)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
gh-123177: Fix prompt for wrapped lines in pyrepl (GH-123324)
When display lines above the cursor come from the cache, the first line
to not come from the cache may be a wrapped line, starting half way
through a logical line in the buffer. Detect and handle this case to
avoid accidentally drawing a stray prompt in the middle of a logical
line.
(cherry picked from commit 602fcf97df)
Co-authored-by: Matt Wozniski <mwozniski@bloomberg.net>
gh-82378: Document the difference between sys.tracebacklimit and the limit arguments (GH-123286)
(cherry picked from commit 70bfef52b5)
Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>