gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (GH-106832)
(cherry picked from commit ebf2c56b33)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
gh-106687: _ssl: use uint64_t for SSL options (GH-106700)
SSL_CTX_get_options() uses uint64_t for options:
https://www.openssl.org/docs/man3.1/man3/SSL_CTX_get_options.html
Fix this compiler warning on Windows with MSC:
conversion from 'uint64_t' to 'long', possible loss of data
(cherry picked from commit ad95c7253a)
Co-authored-by: Victor Stinner <vstinner@python.org>
Add Point definition with this attribute before example
that needs it.
(cherry picked from commit 7aa89e505d)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Docs search: Replace jQuery with vanilla JavaScript (GH-106743)
* Replace jQuery with vanilla JavaScript
* Switch 'var' to 'const' or 'let'
(cherry picked from commit c02ee45031)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-106752: Sync with zipp 3.16.2 (GH-106757)
* gh-106752: Sync with zipp 3.16.2
* Add blurb
(cherry picked from commit 22980dc7c9)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
gh-105235: Prevent reading outside buffer during mmap.find() (GH-105252)
* Add a special case for s[-m:] == p in _PyBytes_Find
* Add tests for _PyBytes_Find
* Make sure that start <= end in mmap.find
(cherry picked from commit ab86426a34)
Co-authored-by: Dennis Sweeney <36520290+sweeneyde@users.noreply.github.com>
gh-105626: Change the default return value of `HTTPConnection.get_proxy_response_headers` (GH-105628)
(cherry picked from commit 490295d651)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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>