gh-117534: Add checking for input parameter in iso_to_ymd (GH-117543)
Moves the validation for invalid years in the C implementation of the `datetime` module into a common location between `fromisoformat` and `fromisocalendar`, which improves the error message and fixes a failed assertion when parsing invalid ISO 8601 years using one of the "ISO weeks" formats.
---------
(cherry picked from commit d5f1139c79)
Co-authored-by: Vlad4896 <166005126+Vlad4896@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* remove load extension doctest since we cannot skip it conditionally
* remove sys.unraisablehook example; using unraisable hooks is not "an
improved debug experience"
(cherry picked from commit e338e1a4ec)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Remove all temporary databases in a dedicated 'testcleanup' step
at the end of the file.
(cherry picked from commit a453f5ef9d)
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-117074: Update Traversable.joinpath docs to the 3.11+ protocol (GH-117113)
(cherry picked from commit e569f9132b)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-115538: Use pathlib to compare prefixes in test_venv (GH-117076)
(cherry picked from commit 52f5b7f9e0)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
gh-102190: Add additional zipfile `pwd=` arg docstrings (gh-102195)
This just documents the parameter that already exists.
---------
(cherry picked from commit a32d693948)
Co-authored-by: Deborah <32307299+dlwrnc@users.noreply.github.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
gh-117347: Fix test_clinic side effects (#117363)
Save/restore converters in ClinicWholeFileTest and
ClinicExternalTest.
(cherry picked from commit 35b6c4a4da)
gh-117310: Remove extra DECREF on "no ciphers" error path in `_ssl._SSLContext` constructor (GH-117309)
Remove extra self DECREF on ssl "no ciphers" error path.
This doesn't come up in practice because nobody links against a broken
OpenSSL library that provides nothing.
(cherry picked from commit 8cb7d7ff86)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-99108: Update and check HACL* version information (GH-117295)
(cherry picked from commit 669ef49c7d)
Co-authored-by: Seth Michael Larson <seth@python.org>
[3.12] gh-115538: Use isolate mode when running venv test_multiprocessing_recursion() (GH-117116)
(cherry picked from commit 4ec347760f)
Co-authored-by: Victor Stinner <vstinner@python.org>
Fix parsing of the following corner cases:
* URLs with only a host name
* URLs containing a fragment
* URLs containing a query
* filenames with only a UNC sharepoint on Windows
(cherry picked from commit 9654daf793)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
* gh-115122: Add --bisect option to regrtest (#115123)
* test.bisect_cmd now exit with code 0 on success, and code 1 on
failure. Before, it was the opposite.
* test.bisect_cmd now runs the test worker process with
-X faulthandler.
* regrtest RunTests: Add create_python_cmd() and bisect_cmd()
methods.
(cherry picked from commit 1e5719a663)
* gh-115720: Show number of leaks in huntrleaks progress reports (GH-115726)
Instead of showing a dot for each iteration, show:
- '.' for zero (on negative) leaks
- number of leaks for 1-9
- 'X' if there are more leaks
This allows more rapid iteration: when bisecting, I don't need
to wait for the final report to see if the test still leaks.
Also, show the full result if there are any non-zero entries.
This shows negative entries, for the unfortunate cases where
a reference is created and cleaned up in different runs.
Test *failure* is still determined by the existing heuristic.
(cherry picked from commit af5f9d682c)
* gh-83434: Disable XML in regrtest when -R option is used (#117232)
(cherry picked from commit d52bdfb19f)
---------
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-117187: Fix XML tests for vanilla Expat <2.6.0 (GH-117203)
This fixes XML unittest fallout from the https://github.com/python/cpython/issues/115398 security fix. When configured using `--with-system-expat` on systems with older pre 2.6.0 versions of libexpat, our unittests were failing.
* sax|etree: Simplify Expat version guard where simplifiable
Idea by Matěj Cepl
* sax|etree: Fix reparse deferral tests for vanilla Expat <2.6.0
This *does not fix* the case of distros with an older version of libexpat with the 2.6.0 feature backported as a security fix. (Ubuntu is a known example of this with its libexpat1 2.5.0-2ubunutu0.1 package)
(cherry picked from commit 9f74e86c78)
Co-authored-by: Sebastian Pipping <sebastian@pipping.org>
Pulls in a new update from https://github.com/hacl-star/hacl-star and fixes our C "namespacing" done by `Modules/_hacl/refresh.sh`.
Co-authored-by: Jonathan Protzenko <protz@microsoft.com>