gh-126664: revert: Use `else` instead of `finally` in docs explaining "with" (GH-128169)
Revert "gh-126664: Use `else` instead of `finally` in "The with statement" documentation. (GH-126665)"
This reverts commit 25257d61cf.
(cherry picked from commit 228f275737)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
gh-127847: Fix position in the special-cased zipfile seek (GH-127856)
---------
(cherry picked from commit 7ed6c5c696)
Co-authored-by: Dima Ryazanov <dima@bucket.xxx>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
* Remove getopt and optparse deprecation notices
* Add new docs sections for command line app helper libraries
* Add guidance on choosing a CLI parsing library to the optparse docs
* Link to the new guidance from the argparse and getopt docs
* Reword intro in docs section for superseded stdlib modules
* Reframe the optparse->argparse guide as a migration guide
rather than as an upgrade guide
---------
(cherry picked from commit 831b6de6d7)
Co-authored-by: Alyssa Coghlan <ncoghlan@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-128049: Fix type confusion bug with the return value of a custom ExceptionGroup split function (GH-128079)
(cherry picked from commit 3879ca0100)
Co-authored-by: Nico-Posada <102486290+Nico-Posada@users.noreply.github.com>
gh-128030: Avoid error from PyModule_GetFilenameObject for non-module (GH-128047)
I missed the extra `PyModule_Check` in GH-127660 because I was looking at
3.12 as the base implementation for import from. This meant that I
missed the `PyModuleCheck` introduced in GH-112661.
(cherry picked from commit 45e6dd63b8)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
gh-128062: Fix the font size and shortcut display of the turtledemo menu (GH-128063)
Leave the font of the menu bar the default to keep it consistent with the rest of the world. Display the shortcut keys in the right way, using the 'accelerator' option.
---------
(cherry picked from commit e163e8d4e1)
Co-authored-by: Zhikang Yan <2951256653@qq.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-128069: brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version (GH-128090)
brew link --overwrite tcl-tk@8 to prevent conflict with GitHub image's version
(cherry picked from commit 46dc1ba9c6)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-126742: Avoid checking for library filename in test_ctypes (GH-128034)
Avoid checking for library filename in `dlerror()` error messages of test_ctypes.
(cherry picked from commit 335e24fb0a)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Set TERM environment variable to "dumb" to disable traceback colors
in IDLE, since IDLE doesn't understand ANSI escape sequences.
(cherry picked from commit 559b0e7013)
Co-authored-by: Victor Stinner <vstinner@python.org>
- Add a helper to set an error from locale-encoded `char*`
- Use the helper for gdbm & dlerror messages
(cherry picked from commit 7303f06846)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-127906: Fix Py_BUILD_ASSERT_EXPR() on Windows
Change Py_BUILD_ASSERT_EXPR implementation on Windows to avoid a
compiler warning about an unnamed structure.
Clarify ast docs to use a less confusing example for `ast.ParamSpec` (GH-127955)
Fix typo in ast docs: ParamSpec defaults
(cherry picked from commit 7900a85019)
Co-authored-by: Steve C <diceroll123@gmail.com>
gh-127353: Allow to force color output on Windows V2 (GH-127926)
(cherry picked from commit 0ac40acec0)
Co-authored-by: Andrey Efremov <duxus@yandex.ru>
Specify that it is valid for floats and ints with 'd' presentation and an error otherwise.
---------
(cherry picked from commit e2325c9db0)
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-127906: Test the limited C API in test_cppext (GH-127916)
(cherry picked from commit d05a4e6a0d)
Co-authored-by: Victor Stinner <vstinner@python.org>
link to the correct output method in documentation (GH-127857)
(cherry picked from commit 11ff3286b7)
Co-authored-by: Viktor Kálmán <kviktor@users.noreply.github.com>
Uses symlinks to install iOS framework into testbed clone, adds a verbose mode
to the iOS runner to hide most Xcode output, adds another mechanism to disable
terminal colors, and ensures that stdout is flushed after every write.
(cherry picked from commit ba2d2fda93)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
Fix typos in `Lib/_pydecimal.py` (GH-127700)
(cherry picked from commit ed037d229f)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
This PR fixes the build issue introduced by the commit 628f6eb from
GH-112207 on systems without thread local support.
(cherry picked from commit f823910bbd)
Co-authored-by: velemas <10437413+velemas@users.noreply.github.com>
This backports the *test* from GH-126938, with changed limit and exception class.
Co-authored-by: Melissa0x1f992 <70096546+Melissa0x1f992@users.noreply.github.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-127257: ssl: Raise OSError for ERR_LIB_SYS (GH-127361)
From the ERR_raise manpage:
ERR_LIB_SYS
This "library code" indicates that a system error is
being reported. In this case, the reason code given
to `ERR_raise()` and `ERR_raise_data()` *must* be
`errno(3)`.
This PR only handles ERR_LIB_SYS for the high-lever error types
SSL_ERROR_SYSCALL and SSL_ERROR_SSL, i.e., not the ones where
OpenSSL indicates it has some more information about the issue.
(cherry picked from commit f4b31edf2d)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Add `extern "C"` around `PyTraceMalloc_` functions. (GH-127772)
Pretty much everything else exported by Python.h has an extern "C"
annotation, yet this header appears to be missing one.
(cherry picked from commit 2cdeb61b57)
Co-authored-by: Peter Hawkins <hawkinsp@cs.stanford.edu>
This fixes a UBSan failure (unaligned zero-size memcpy) in `dictobject.c`.
(cherry picked from commit 9af96f4406)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Add versionadded annotation to use_system_logger feature.
(cherry picked from commit 51216857ca)
Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>