[3.14] gh-128605: Revert "Add branch protections for x86_64 in asm_tr…ampoline.S (GH-128606) (GH-135077)" (GH-135175)
This reverts commit 899cca6dbf,
which broke buildbots.
(cherry picked from commit b477e21d5c)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
feat(docs): type fix - apply pep8 by using docstring instead of comment in the doc. (GH-135181)
Giving the right example incitates the tutorial readers to do the same in the future.
(cherry picked from commit 343182853f)
Co-authored-by: Jean-Louis GUENEGO <jlguenego@gmail.com>
gh-134993: Add os.lstat() to os.supports_dir_fd (GH-135188)
(cherry picked from commit e004cf8fd5)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-134989: Fix Py_RETURN_NONE in the limited C API (GH-135165)
Fix Py_RETURN_NONE, Py_RETURN_TRUE and Py_RETURN_FALSE macros in the
limited C API 3.11 and older:
Don't treat Py_None, Py_True and Py_False as immortal.
(cherry picked from commit 9258f3da91)
gh-135124: Change stdout errors in regrtest worker process (GH-135138)
Set sys.stdout encoder error handler to backslashreplace in regrtest
workers to avoid UnicodeEncodeError when printing a traceback
or any other non-encodable character.
Move the code from the Regrtest class to setup_process().
Call setup_process() earlier, before displaying regrtest headers.
(cherry picked from commit 3d396ab759)
Co-authored-by: Victor Stinner <vstinner@python.org>
Modifies the environment handling and execution arguments of the Android management
script to support the compilation of third-party binaries, and the use of the testbed to
invoke third-party test code.
(cherry picked from commit 2e1544fd2b)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
The `test_ssl_in_multiple_threads` test failed because `test_check_hostname_idn()`
modified the global warnings filters via `warnings_helper.check_no_resource_warning()`.
Disable the warnings check in the multi-threaded test because `warnings_helper` isn't
thread-safe in 3.13 or earlier.
(cherry picked from commit 40c8be0008)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
* Fix for 3.13
---------
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Sam Gross <colesbury@gmail.com>
(cherry picked from commit eb145fabbd)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
On a fresh Xcode install (including some CI provider configurations), there is
no pre-existing testing set that can be used to identify simulator models. Use
the default device set to detect available models instead. Live testing
simulators are still created in the testing set.
(cherry picked from commit dba9de731b)
Co-authored-by: Joe Rickerby <joerick@mac.com>
The `getlogin` function is not thread-safe: replace with `getlogin_r` where
available.
(cherry picked from commit 1ffe913c20)
Co-authored-by: Duane Griffin <duaneg@dghda.com>
[3.14] gh-128605: Add branch protections for x86_64 in asm_trampoline.S (GH-128606) (GH-135077)
Apply Intel Control-flow Technology for x86-64 on asm_trampoline.S.
Required for mitigation against return-oriented programming (ROP)
and Call or Jump Oriented Programming (COP/JOP) attacks.
Manual application is required for the assembly files.
See also: https://sourceware.org/annobin/annobin.html/Test-cf-protection.html
(cherry picked from commit 899cca6dbf)
Co-authored-by: stratakis <cstratak@redhat.com>
gh-134875: Fix mimallc build error for the old compilers (gh-134994)
(cherry picked from commit b525e31b7f)
Co-authored-by: Donghee Na <donghee.na@python.org>
50 producer and 50 consumer threads need more than 5GB of memory.
(cherry picked from commit 7a79f52d83)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
random.getrandbits() can now generate more that 2**31 bits.
random.randbytes() can now generate more that 256 MiB.
(cherry picked from commit 68784fed78)
The `textiowrapper_iternext` function called `_textiowrapper_writeflush`, but did not
use a critical section, making it racy in free-threaded builds.
(cherry picked from commit 44fb7c361c)
Co-authored-by: Duane Griffin <duaneg@dghda.com>
OpenSSL and HACL*-based hash functions constructors now support both `data` and `string` parameters.
Previously these constructor functions inconsistently supported sometimes `data` and sometimes `string`,
while the documentation expected `data` to be given in all cases.
(cherry picked from commit c6e63d9d35)
(cherry picked from commit 379d0bc956)
gh-134835: Remove outdated list from `howto/urllib2.rst` (GH-134844)
🫖
(cherry picked from commit 3704171415)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
gh-134954: Hard-cap max file descriptors in subprocess test fd_status (GH-134955)
* Hard-cap max file descriptors in subprocess test fd_status
On some systems, `SC_OPEN_MAX` may return a very large value (i.e. 10**30), leading to the subprocess test timing out (or run forever).
Prevent this situation by applying a hard cap on how many file descriptors are checked.
* Fix typo in usage docstring
s/fd_stats/fd_status/
(cherry picked from commit f58873e4b2)
Co-authored-by: Itamar Oren <itamarost@gmail.com>
Contrary to the current docs, ast.Constant will never hold containers
such as frozenset or tuple; the Python parser only emits it for simple
literals.
For precision, add the exact list of types that may be contained in an
ast.Constant.
(cherry picked from commit 381020d41f)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
This adds a warning about the possibly-missing NUL terminator, but in a way
that doesn't make it sound like a bug/wart.
(cherry picked from commit b783e1791b)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
GH-134848: Use a set to store ``AuditEvents.sources`` (GH-134849)
(cherry picked from commit b265a7ddeb)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-133711: Fix test_readline.test_nonascii() for UTF-8 Mode (GH-134841)
Skip the test if the Python UTF-8 Mode is enabled and the LC_CTYPE
encoding is not UTF-8.
(cherry picked from commit 4635115c3f)
Co-authored-by: Victor Stinner <vstinner@python.org>