Change the unit test case to use `getattr()` so that we avoid the
bytecode specializer optimizing the access. The specializer will call
the `__eq__` method before the unit test expects, causing it to fail.
In the 3.14 branch (gh-128164) the test is changed in a different way
to avoid the same issue.
Two races related to the type lookup cache, when used in the
free-threaded build. This caused test_opcache to sometimes fail (as
well as other hard to re-produce failures).
When built on a MIPS architecture, `_MIPS_SIM` is used to determine
architecture specifics. The value is expected to match either
`_ABIO32`, `_ABIN32` or `_ABI64`.
In `gcc` config/mips/mips.h these values are defined as compiler
`builtin_define` inside of a switch/case. That means, mips64el and
mips64 architectures know about `_ABI64` but don't know about `_ABIO32`
and `_ABIN32`. In turn, when CPython tries to use them in comparison,
they may be undefined identifiers.
In default compiler behavior, the undefined identifier will be
evaluated as zero, and it will not match `_MIPS_SIM`. However, the
issues pop up when `-Wundef` (or, even worse, `-Werror=undef`) compiler
flag is enabled. Then suddenly it's visible as a warning or error.
(cherry picked from commit 6985e2e6de)
Co-authored-by: Valters Jansons <sigv@users.noreply.github.com>
[tests] fix test_fcntl issue when run in a ChromeOS linux runtime (GH-133053)
* [tests] test_fcntl fails when run in a ChromeOS linux runtime container.
It doesn't appear to support F_NOTIFY? Detect the lack of that and skip the test.
(cherry picked from commit 355ee1a429)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-133016: Fix a reference to removed `asyncio.futures.TimeoutError` (GH-133019)
Just use the builtin `TimeoutError`, and remove the import of `futures`.
(cherry picked from commit 8d6d7386a3)
Co-authored-by: John <john-xyz@outlook.com>
Revert "[3.13] gh-132921: Fix setuptools._distutils.dep_util deprecation (GH-132923) (#132926)"
This reverts commit 3776ade2e8.
setuptools.modified module is not available on old setuptools
versions.
gh-91221: fix `test_curses.test_use_default_colors` for xterm-256color (GH-132990)
Terminals with `xterm-256color` Xterm support may use 15 (bright white) as their default foreground color.
(cherry picked from commit 7f02ded29f)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Christian Veenhuis <124370897+ChVeen@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
gh-132912: Set 15 min timeout on GHA Hypothesis CI (GH-132914)
(cherry picked from commit eb2e430b88)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906)
Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482eda3)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-98347: Add links to python-isal in the documentation (GH-98637)
Clearly note that this is primarily intended for users for who zlib/gzip is a bottleneck.
(cherry picked from commit b1fc8b69ec)
Co-authored-by: Ruben Vorderman <r.h.p.vorderman@lumc.nl>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Modifies the test helper that counts the list of open file descriptors to use
the optimised ``/dev/fd`` approach on all Apple platforms, not just macOS. This
avoids crashes caused by guarded file descriptors.
(cherry picked from commit 862fd89036)
Co-authored-by: John <johnzhou721@gmail.com>
* Skip test_ioctl_tcflush if termios.TCFLSH is not available.
* Do not skip ALL ioctl() tests when /dev/tty is not available.
(cherry picked from commit 4b4b9fbb06)
gh-132713: Fix typing.Union[index] race condition (GH-132802)
Add union_init_parameters() helper function. Use a critical section
to initialize the 'parameters' member.
(cherry picked from commit dc3e9638c2)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-132769: Refactor possible read-out-of-bounds in `lexer.c` (GH-132770)
(cherry picked from commit ea8ec95cfa)
Co-authored-by: sobolevn <mail@sobolevn.me>
gh-85583: Add an overview of formatted string literals (f-strings) to ``str`` (GH-132689)
(cherry picked from commit fee808936f)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Test with different types of argument: integer, mutable and immutable
buffers, immutable buffer with mutable_flag set to false.
(cherry picked from commit a04390b4da)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks (GH-130721)
(cherry picked from commit 492e3e6976)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-129327: revise hashlib documentation to account for FIPS removing sha1 (GH-132729)
* gh-129327: revise hashlib documentation to account for FIPS removing sha1
More generally, the current documentation is a bit scattered, talking
about what terms are "equal" despite those terms not being very
interesting and given the term "secure hash", probably wrong (because
md5 and sha1 are not secure anymore).
Let's talk about cryptographically secure instead, and note that two of
them aren't. And then we can also link to the source for NIST going
through the removal process for SHA1.
* Add Gregors Suggestion
* Clean up
---------
(cherry picked from commit a16586c9e7)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Eli Schwartz <eschwartz@gentoo.org>
Docs: Fix REPL example in `Doc/library/shutil.rst` (GH-132700)
(cherry picked from commit e154e4db36)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>