gh-99079: Update Windows build to use OpenSSL 3.0.9 (GH-106649)
(cherry picked from commit e2d7366fb3)
Co-authored-by: Steve Dower <steve.dower@python.org>
gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213)
Fetch CONFIG_ARGS from the original source directory, instead of from
the copied source tree. When "make clean" is executed in the copied
source tree, the build directory is cleared and the configure argument
lookup fails. However, the original source directory still contains this
information.
(cherry picked from commit de827322ca)
Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
gh-102541: Add test case for help() for non_existent_module (GH-106340)
Test fix for when one enters, for instance, 'abd' at the 'help>' prompt.
---------
(cherry picked from commit 292ac4bfe9)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-106403: Restore weakref support for TypeVar and friends (GH-106418)
(cherry picked from commit 945d3cbf2e)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627)
gh-86618 assumed a-b-c = a-(b+c) = a-d where d = b+d.
For floats 2.0, 1.0, and 0.9999999999999999, this assumption
is false. The net change of 1.1102230246251565e-16 to 0.0
results in division by 0. Revert the replacement. Add test.
(cherry picked from commit a2d54d4e8a)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (GH-106468)
For example:
class Flag(enum.Flag):
A = 0x01
B = 0x02
MASK = 0xff
~Flag.MASK is Flag(0)
(cherry picked from commit 95b7426f45)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
gh-103968: What's New: Add porting hints for PyType_From with metaclasses (GH-105698)
(cherry picked from commit af5cf1e751)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API) (GH-105127)
Detect email address parsing errors and return empty tuple to indicate the parsing error (old API). This fixes or at least ameliorates CVE-2023-27043.
---------
(cherry picked from commit 18dfbd0357)
Co-authored-by: Thomas Dwyer <github@tomd.tel>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-94777: Fix deadlock in ProcessPoolExecutor (GH-94784)
Fixes a hang in multiprocessing process pool executor when a child process crashes and code could otherwise block on writing to the pipe. See GH-94777 for more details.
(cherry picked from commit 6782fc0502)
Co-authored-by: Louis Paulot <55740424+lpaulot@users.noreply.github.com>
gh-103186: Fix or catch 'extra' stderr output from unittests (GH-103196)
Reduce test noise by fixing or catching and testing stderr messages from individual tests.
test_cmd_line_script.test_script_as_dev_fd calls spawn_python and hence subprocess.Popen with incompatible arguments. On POSIX, pass_fds forces close_fds to be True (subprocess.py line 848). Correct the call.
test_uuid.test_cli_namespace_required_for_uuid3: when the namespace is omitted, uuid.main calls argparse.Argument_Parser.error, which prints to stderr before calling sys.exit, which raises SystemExit. Unittest assertRaises catches the exception but not the previous output. Catch the output and test it.
test_warnings.test_catchwarnings_with_simplefilter_error similarly prints before raising. Catch the output and test it.
---------
(cherry picked from commit 9d582250d8)
Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
gh-105227: Add PyType_GetDict() (GH-105747)
This compensates for static builtin types having `tp_dict` set to `NULL`.
(cherry picked from commit a840806d33)
Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Clarify how topics.py gets created. (GH-106121)
When changing docs, it was easy to find text in topics.py, and I
wondered whether I was supposed to edit it. Thankfully, the top of the
file says it's auto-generated, so I knew I didn't have to edit it. But I
didn't know what started the auto-generation process.
It's part of the release process, so I'll leave a note here for future
editors.
(cherry picked from commit dac1e36490)
Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
Move implementation specific RE tests to separate class (GH-106563)
(cherry picked from commit 8cb6f9761e)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-101880: add link to object.__hash__() in hash() builtin documentation (GH-101883)
(cherry picked from commit ec7180bd1b)
Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
Some items remained uninitialized if _sre.template() was called with invalid
indices. Then attempt to clear them in the destructor led to dereferencing
of uninitialized pointer.
(cherry picked from commit 2ef1dc37f0)
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
gh-90876: Restore the ability to import multiprocessing when `sys.executable` is `None` (GH-106464)
Prevent `multiprocessing.spawn` from failing to *import* in environments
where `sys.executable` is `None`. This regressed in 3.11 with the addition
of support for path-like objects in multiprocessing.
Adds a test decorator to have tests only run when part of test_multiprocessing_spawn to `_test_multiprocessing.py` so we can start to avoid re-running the same not-global-state specific test in all 3 modes when there is no need.
(cherry picked from commit c60df361ce)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Clarify state of CancelledError in doc (GH-106453)
This change makes it explicit that asyncio.CancelledError is not a subclass of Exception.
(cherry picked from commit 12a9813808)
Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com>
gh-105256: What's New note for comprehension over locals() (GH-106378)
(cherry picked from commit 13aefd175e)
Co-authored-by: Carl Meyer <carl@oddbird.net>
gh-105340: include hidden fast-locals in locals() (GH-105715)
* gh-105340: include hidden fast-locals in locals()
(cherry picked from commit 104d7b760f)
Co-authored-by: Carl Meyer <carl@oddbird.net>
shlex docs: remove outdated note (GH-106463)
As the versionchanged notice says, this note is no longer true on 3.12+.
(cherry picked from commit c16ea94abc)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
gh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542)
When inverting a Flag member (or boundary STRICT), only consider other canonical flags; when inverting an IntFlag member (or boundary KEEP), also consider aliases.
(cherry picked from commit 59f009e589)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Since gh-104798 (Use setuptools in peg-generator and reenable
tests), the TestCParser test case has been producing ref leaks.
(cherry picked from commit 41ad4dfc04)
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
RTSPS is the permanent scheme defined in
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
alongside RTSP and RTSPU schemes.
(cherry picked from commit f3266c05b6)
Co-authored-by: zentarim <33746047+zentarim@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Display the sanitizer config in the regrtest header. (GH-105301)
Display the sanitizers present in libregrtest.
Having this in the CI output for tests with the relevant environment
variable displayed will help make it easier to do what we need to
create an equivalent local test run.
(cherry picked from commit 852348ab65)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
This ensures that `commoninstall` is completed before `bininstall` is
started when parallel builds are used (`make -j install`), and so the
`python3` symlink is only installed after all standard library modules
are installed.
(cherry picked from commit 990cb3676c)
gh-106368: Add tests for formatting helpers in Argument Clinic (GH-106415)
(cherry picked from commit 2fb9480c83)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
We match paths using the `_lines` attribute, which is derived from the
path's string representation. The bug arises because an empty path's string
representation is `'.'` (not `''`), which is matched by the `'*'` wildcard.
(cherry picked from commit b4efdf8cda)