(cherry picked from commit f071f01b7b)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Authenticate socket connection for `socket.socketpair()` fallback when the platform does not have a native `socketpair` C API. We authenticate in-process using `getsocketname` and `getpeername` (thanks to Nathaniel J Smith for that suggestion).
(cherry picked from commit 78df1043db)
Co-authored-by: Seth Michael Larson <seth@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Fix regression introduced in gh-100884: AttributeError when re-fold a long
address list.
Also fix more cases of incorrect encoding of the address separator in the
address list missed in gh-100884.
(cherry picked from commit 858b9e85fc)
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>
[3.12] gh-117347: Fix test_clinic side effects (GH-117363) (GH-117365)
gh-117347: Fix test_clinic side effects (GH-117363)
Save/restore converters in ClinicWholeFileTest and
ClinicExternalTest.
(cherry picked from commit c80d13838d)
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 35b6c4a4da)
Co-authored-by: Victor Stinner <vstinner@python.org>
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>
[3.12] gh-115538: Use isolate mode when running venv test_multiproces… (GH-117264)
[3.12] gh-115538: Use isolate mode when running venv test_multiprocessing_recursion() (GH-117116)
(cherry picked from commit 4ec347760f)
(cherry picked from commit ca0793980b)
Co-authored-by: AN Long <aisk@users.noreply.github.com>
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>
[3.12] gh-83434: Sync libregrtest and test_regrtest with the main branch (GH-117250)
* gh-115122: Add --bisect option to regrtest (GH-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 (GH-117232)
(cherry picked from commit d52bdfb19f)
---------
(cherry picked from commit 477ef9015c)
Co-authored-by: Victor Stinner <vstinner@python.org>
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>
gh-117127: glob tests: Reopen dir_fd to pick up directory changes (GH-117128)
(cherry picked from commit 42ae924d27)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-75988: Fix issues with autospec ignoring wrapped object (#115223)
* set default return value of functional types as _mock_return_value
* added test of wrapping child attributes
* added backward compatibility with explicit return
* added docs on the order of precedence
* added test to check default return_value
(cherry picked from commit 735fc2cbbc)
gh-117061: Fix test_posix.test_sched_setaffinity() on RHEL9 (GH-117126)
On RHEL9, sched_setaffinity(0, []) does not fail.
(cherry picked from commit 50f9b0b1e0)
Co-authored-by: Victor Stinner <vstinner@python.org>
* document equivalent command-line options for all environment variables
* document equivalent environment variables for all command-line options
* reduce the size of variable and option descriptions to minimum
* remove the ending period in single-sentence descriptions
(cherry picked from commit b85572c47d)
(cherry picked from commit 4be9fa8961)
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Update titles and subtitles on landing page template (GH-116914)
* Update titles and subtitles on landing page template
* address review from gvanrossum
* Edits from hugovk review
* Change word order back. Down the road we should split license and history
(cherry picked from commit c514a975ab)
Co-authored-by: Carol Willing <carolcode@willingconsulting.com>
If you catch DuplicateOptionError / DuplicateSectionError when reading a
config file (the intention is to skip invalid config files) and then
attempt to use the ConfigParser instance, any values it *had* read
successfully so far, were stored as a list instead of string! Later
`get` calls would raise "AttributeError: 'list' object has no attribute
'find'" from somewhere deep in the interpolation code.
(cherry picked from commit b1bc37597f)
gh-90872: Fix subprocess.Popen.wait() for negative timeout (#116989)
On Windows, subprocess.Popen.wait() no longer calls
WaitForSingleObject() with a negative timeout: pass 0 ms if the
timeout is negative.
(cherry picked from commit 27cf3ed00c)