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>
gh-122334: Fix crash when importing ssl after re-initialization (GH-122481)
* Fix crash when importing ssl after re-initialization
(cherry picked from commit 9fc1c992d6)
Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
gh-120974: Make asyncio `swap_current_task` safe in free-threaded build (GH-122317)
* gh-120974: Make asyncio `swap_current_task` safe in free-threaded build
(cherry picked from commit b5e6fb39a2)
Co-authored-by: Sam Gross <colesbury@gmail.com>
gh-122133: Rework pure Python socketpair tests to avoid use of importlib.reload. (GH-122493)
(cherry picked from commit f071f01b7b)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-116622: Fix testPyObjectPrintOSError on Android (GH-122487)
Adds extra handling for way BSD/Android return errors from calls to fwrite.
(cherry picked from commit 82db572813)
Co-authored-by: Malcolm Smith <smith@chaquo.com>
Currently, idle-dev@python.org and idle-dev mailing list
serve to collect spam (90+%). Change About IDLE to direct
discussions to discuss.python.org. Users are already
doing so.
(cherry picked from commit 29c04dfa27)
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Remove outdated note about instance methods from datamodel.rst (GH-122471)
(cherry picked from commit c68cb8e0c9)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
gh-119896: Fix CTRL-Z behavior in the new REPL on Windows (GH-122217)
(cherry picked from commit d1a1bca1f0)
Co-authored-by: Dino Viehland <dinoviehland@meta.com>
The adaptive counter doesn't do anything currently in the free-threaded
build and TSan reports a data race due to concurrent modifications to
the counter.
(cherry picked from commit 2b163aa9e7)
Co-authored-by: Sam Gross <colesbury@gmail.com>