gh-116622: Add Android test script (GH-121595)
Adds a script for running the test suite on Android emulator devices. Starting
with a fresh install of the Android Commandline tools; the script manages
installing other requirements, starting the emulator (if required), and
retrieving results from that emulator.
(cherry picked from commit f84cce6f25)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
gh-116622: Android logging fixes (GH-122698)
Modifies the handling of stdout/stderr redirection on Android to accomodate
the rate and buffer size limits imposed by Android's logging infrastructure.
(cherry picked from commit b0c48b8fd8)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
gh-123046: Fix regexp to catch cases where the module name is omitted from the weakref repr (GH-123047)
(cherry picked from commit 786cac0c64)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: sobolevn <mail@sobolevn.me>
gh-116608: Apply style and compatibility changes from importlib_metadata. (GH-123028)
(cherry picked from commit e913d2c87f)
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
GH-109975: Copyedit 3.13 What's New: New Features (GH-122990)
(cherry picked from commit b106cf8d97)
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: Brandt Bucher <brandtbucher@gmail.com>
gh-123005: Add version added in enum.Flag.__len__ (GH-123007)
(cherry picked from commit 8e2dc7f380)
Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
GH-85633: Fix pathlib test failures on filesystems without world-write. (GH-122883)
Replace `umask(0)` with `umask(0o002)` so the created files are not
world-writable, and replace `umask(0o022)` with `umask(0o026)` to check
that permissions for 'others' can still be set.
(cherry picked from commit 5f68511522)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
gh-122944: Fix incorrect prompt strings in the Python Tutorial (GH-122949)
In the REPL, top level comments are followed by a primary, not secondary prompt.
Fix the places in the in the tutorial that use the latter.
(cherry picked from commit be90648fb2)
Co-authored-by: Damien <81557462+Damien-Chen@users.noreply.github.com>
gh-122701: Fix wording of raw strings/bytes in `lexical_analysis.rst` (GH-122702)
(cherry picked from commit ea70439bd2)
Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Docs: Standardise versionchanged text in weakref.rst (GH-122898)
(cherry picked from commit db8b83c2b0)
Co-authored-by: Rafael Fontenelle <rffontenelle@users.noreply.github.com>
GH-120794: Use example paths with multiple parts in pathlib docs (GH-122887)
In the documentation of `PosixPath` and `WindowsPath`, and their `Pure*`
equivalents, use example paths with multiple non-anchor parts.
(cherry picked from commit 363374cf69)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-122868: Add more lower bounds for sphinxcontrib dependencies (GH-122891)
(cherry picked from commit 0959142e4d)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-116622: Rename build variable MODULE_LDFLAGS back to LIBPYTHON (GH-122764)
(LIBPYTHON was renamed MODULE_LDFLAGS in commit 7f5e3f04f.)
(cherry picked from commit 2f5c3b09e4)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
gh-122255: Add black box tests in test_warnings (GH-122227)
They are similar to white box tests for gh-86298 in test_importlib.
(cherry picked from commit fe13c9baf4)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-105376: Restore deprecated logging warn() method (GH-122775)
This reverts commit dcc028d924 and
commit 6c54e5d721.
Keep the deprecated logging warn() method in Python 3.13.
(cherry picked from commit d3239976a8)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
* Share common classes.
* Use exactly representable floats and exact tests.
* Check the sign of zero components.
* Remove duplicated tests (mostly left after merging int and long).
* Reorder tests in more consistent way.
* Test more error messages.
* Add tests for missed cases.
(cherry picked from commit bf098d4157)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Before, the exception caused by calling non-default sys.excepthook
in code.InteractiveInterpreter bubbled up to the caller, ending the REPL.
(cherry picked from commit bd3d31f380)
Co-authored-by: CF Bolz-Tereick <cfbolz@gmx.de>
Fix _PyArg_UnpackKeywordsWithVararg for the case when argument for
positional-or-keyword parameter is passed by keyword.
There was only one such case in the stdlib -- the TypeVar constructor.
(cherry picked from commit 540fcc62f5)
gh-122728: Fix SystemError in PyEval_GetLocals() (GH-122735)
Fix PyEval_GetLocals() to avoid SystemError ("bad argument to
internal function"). Don't redefine the 'ret' variable in the if
block.
Add an unit test on PyEval_GetLocals().
(cherry picked from commit 4767a6e31c)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-121103: Update site module docs for free-threaded installs (GH-122737)
(cherry picked from commit 1429651a06)
Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
gh-121650: Encode newlines in headers, and verify headers are sound (GH-122233)
GH-GH- Encode header parts that contain newlines
Per RFC 2047:
> [...] these encoding schemes allow the
> encoding of arbitrary octet values, mail readers that implement this
> decoding should also ensure that display of the decoded data on the
> recipient's terminal will not cause unwanted side-effects
It seems that the "quoted-word" scheme is a valid way to include
a newline character in a header value, just like we already allow
undecodable bytes or control characters.
They do need to be properly quoted when serialized to text, though.
GH-GH- Verify that email headers are well-formed
This should fail for custom fold() implementations that aren't careful
about newlines.
(cherry picked from commit 0976339818)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Bas Bloemsaat <bas@bloemsaat.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-122573: Require Python 3.10 or newer for Windows builds (GH-122574)
Match statements in tooling require a more recent Python. Tools/cases_generator/*.py (and `Tools/jit/*.py` in 3.13+).
(cherry picked from commit d0b92dd5ca)
Co-authored-by: Jonathan Protzenko <protz@microsoft.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>