gh-123836: Check zero signs in math_testcases.txt (GH-123854)
Just like cmath_testcases.txt. These tests require IEEE 754 anyway.
Correct zero sign for sqrt tests to match math.h convention.
(cherry picked from commit 28aea5d07d)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
GH-124108: Skip test_locale.test_strcoll_with_diacritic() on NetBSD (GH-124110)
Skip test_strcoll_with_diacritic() and test_strxfrm_with_diacritic()
of test_locale on NetBSD due to lack of UTF-8 LC_COLLATE
support.
(cherry picked from commit 10de3600a9)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Add test coverage for "starred kind" in _PyPegen_set_expr_context
(cherry picked from commit 8231a24454)
Co-authored-by: Mark Jason Dominus (陶敏修) <mjd@pobox.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-123974: Fix time.get_clock_info() on NetBSD (GH-123975)
Fix OSError for thread_time clock on NetBSD by setting default resolution.
(cherry picked from commit b1d6f8a2ee)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
Use a global volatile variable and check if the function is not NULL
to use the variable. Otherwise, a compiler optimization can remove
the variable making the check useless.
Co-authored-by: Paul Smith <paul@mad-scientist.net>
gh-123811: test that round() can return signed zero (GH-123829)
(cherry picked from commit d2b9b6f919)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-123881: Add additional test coverage for PEP 695 edge cases (GH-123886)
(cherry picked from commit b52de7e02d)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-123892: Add "_wmi" to sys.stdlib_module_names (GH-123893)
(cherry picked from commit fb1b51a58d)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-123823: Fix test_posix for unsupported posix_fallocate on NetBSD (GH-123824)
Fix test_posix for unsupported posix_fallocate on NetBSD.
(cherry picked from commit df4f0cbfad)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
gh-123789: `secrets.randbits` returns only non-negative int (GH-123801)
(cherry picked from commit beee91cdcc)
Co-authored-by: Wulian <1055917385@qq.com>
gh-122792: Make IPv4-mapped IPv6 address properties consistent with IPv4 (GH-122793)
Make IPv4-mapped IPv6 address properties consistent with IPv4.
(cherry picked from commit 76a1c5d183)
Co-authored-by: Seth Michael Larson <seth@python.org>
This checks are redundant in normal circumstances and can only work if
the extension registry was intentionally broken.
(cherry picked from commit 0c3ea30238)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
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)
Add the glossary term "immortal", mark it as an implementation detail
(cherry picked from commit 6754566a51)
(cherry picked from commit 1af74fa652)
(Unlike the original commits, this adds the entire entry.)
Detect email address parsing errors and return empty tuple to
indicate the parsing error (old API). Add an optional 'strict'
parameter to getaddresses() and parseaddr() functions. Patch by
Thomas Dwyer.
Co-Authored-By: Thomas Dwyer <github@tomd.tel>
(cherry picked from commit 4a153a1d3b)
Co-authored-by: Victor Stinner <vstinner@python.org>