gh-117174: Adapt `test_multiple_statements_fail_early` to new REPL behavior (follow-up gh-131065) (GH-131836)
Adapt test to new REPL behavior (follow-up gh-117174)
(cherry picked from commit a6cf8275f8)
Co-authored-by: Bartosz Sławecki <bartosz@ilikepython.com>
The bin tag is 3.0.16.1 because we rebuilt without uplink support to fix gh-131804.
This PR also prevents making calls that are now unsafe without uplink, and updates
the tests to property interpret these failures as unsupported.
gh-117174: Adapt test_multiple_statements_fail_early now that we have always source (GH-131065)
(cherry picked from commit 4192ce17ba)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
gh-118518: Minor improvements to perf docs (GH-130866)
Minor improvements to perf docs
(cherry picked from commit ecdf6b15b0)
Co-authored-by: stratakis <cstratak@redhat.com>
gh-128231: Use `runcode()` return value for failing early (GH-129488)
(cherry picked from commit 7ed3dc6392)
Co-authored-by: Bartosz Sławecki <bartoszpiotrslawecki@gmail.com>
gh-128446: Run Windows CI tests on each commit (GH-131702)
(cherry picked from commit 7d9442f0d5)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-131712: Build _suggestions extension on Windows (GH-131759)
Add a test checking that the '_suggestions' extension is available.
(cherry picked from commit 9ef9d687ff)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-131762: Fixed dereferencing the pointer 'parser_token->metadata' with a NULL value (GH-131764)
(cherry picked from commit 2c686a9ac2)
Co-authored-by: rialbat <47256826+rialbat@users.noreply.github.com>
gh-131741: Add documentation for Windows version detection change in `platform` (GH-131742)
Document the behavior change between 3.11 & 3.12, where ``platform`` now correctly detects Windows 11 and Windows Server releases past Windows Server 2012.
(cherry picked from commit b9ca438daa)
Co-authored-by: Idan Noiman <idann@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Wulian <1055917385@qq.com>
document that `sys._is_gil_enabled` is CPython-specific (GH-131748)
(cherry picked from commit ac12de2e6a)
Co-authored-by: Ralf Gommers <ralf.gommers@gmail.com>
gh-129900: Fix `SystemExit` return codes when the REPL is started from the command line (GH-129901)
(cherry picked from commit 90b82f2b61)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-131670: Fix crash in `anext()` when `__anext__` is sync and raises (GH-131682)
(cherry picked from commit 929afd1d6e)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-131045: [Enum] fix flag containment checks when using values (GH-131053)
Check would fail if value would create a pseudo-member, but that member
had not yet been created. We now attempt to create a pseudo-member for
a passed-in value first.
(cherry picked from commit 17d06aeb54)
Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
gh-131418: remove unused legacy typedefs in `{md5,sha1}module.c` (GH-131420)
- Remove legacy typedefs `MD5_INT32` and `MD5_INT64` in `Modules/md5module.c`
- Remove legacy typedefs `SHA1_INT32` and `SHA1_INT64` in `Modules/sha1module.c`.
Those legacy typedefs were used to detect whether the host platform could
correctly implement MD5 and SHA-1, but this is no longer needed as we now
fallback to HACL* implementations.
(cherry picked from commit a9a399f0ec)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-131357: Add a set of asserts to test.test_capi.test_bytearray (GH-131554)
add a set of asserts to test.test_capi.test_bytearray
1. Assert empty bytearray object for PyByteArray_Check.
2. Assert empty bytearray object for PyByteArray_CheckExact.
3. Assert 0-size bytearray object for PyByteArray_Size.
4. Assert empty bytearray object for PyByteArray_AsString.
5. Assert concatenation of the bytearray object with itself for PyByteArray_Concat.
(cherry picked from commit f3bf304c27)
Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
The `sys_tracing_threads` variable should be read inside `LOCK_SETUP()`.
(cherry picked from commit 0de5e0c544)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-131507: Refactor screen and cursor position calculations (GH-131547)
This is based off GH-131509.
(cherry picked from commit 4cc82ffa37)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
gh-131441: Add a set of asserts to test.test_capi.test_list (GH-131442)
(cherry picked from commit 2433cc79d7)
Co-authored-by: Nybblista <170842536+nybblista@users.noreply.github.com>
gh-88887: Cleanup `multiprocessing.resource_tracker.ResourceTracker` upon deletion (GH-130429)
(cherry picked from commit f53e7de6a8)
Co-authored-by: luccabb <32229669+luccabb@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
The structure definition for `PyTypeObject` is in `Include/cpython/object.h`,
not in `Include/object.h`.
(cherry picked from commit a0478c9f0c)
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
gh-131117: Update tp_finalize example to use PyErr_GetRaisedException (GH-131118)
The tp_finalize C API doc used PyErr_Fetch() and PyErr_Restore() in
its example code. That API was deprecated in 3.12.
Update to point to the suggested replacement function
PyErr_GetRaisedException() which has a sample usage.
(cherry picked from commit a4832f6b9a)
Co-authored-by: Cody Maloney <cmaloney@users.noreply.github.com>
gh-131263: Skip test_timerfd_negative on NetBSD to prevent system freeze (GH-131431)
(cherry picked from commit 8ad4646c67)
Co-authored-by: Furkan Onder <furkanonder@protonmail.com>
gh-131417: Mention asyncio Future and Task in docs for generic classes list (GH-131422)
Mention asyncio Future and Task in docs for generic classes list
(cherry picked from commit 61b4b2c57c)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
Ensures that failures in test setup don't result in dangling threads.
(cherry picked from commit 01b5abbc53)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
gh-121284: Fix email address header folding with parsed encoded-word (GH-122754)
Email generators using email.policy.default may convert an RFC 2047
encoded-word to unencoded form during header refolding. In a structured
header, this could allow 'specials' chars outside a quoted-string,
leading to invalid address headers and enabling spoofing. This change
ensures a parsed encoded-word that contains specials is kept as an
encoded-word while the header is refolded.
[Better fix from @bitdancer.]
---------
(cherry picked from commit 295b53df2a)
Co-authored-by: Mike Edmunds <medmunds@gmail.com>
Co-authored-by: R David Murray <rdmurray@bitdance.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
gh-116666: Add "token" glossary term (GH-130888)
Add glossary entry for `token`, and link to it.
Avoid talking about tokens in the SyntaxError intro (errors.rst); at this point
tokenization is too much of a technical detail. (Even to an advanced reader,
the fact that a *single* token is highlighted isn't too relevant. Also, we don't
need to guarantee that it's a single token.)
(cherry picked from commit 30d5205849)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-127667: refactor and improve `_hashopenssl.c` error branches (#131145)
Refactor `_setException()` into different helpers that can be used separately:
- set_ssl_exception_from_errcode(): set an exception from an explicit SSL error code.
- raise_ssl_error(): set an exception from the last SSL error code or use a user-defined message.
- notify_ssl_error_occurred(): same as raise_ssl_error() but with a generic default message.
(cherry-picked from commit ac50ece6ce).
gh-131325: fix sendfile fallback implementation to drain data after writing to transport (GH-131376)
(cherry picked from commit 94f4d87aeb)
Co-authored-by: Kumar Aditya <kumaraditya@python.org>