The call to `PySequence_List()` could temporarily unlock and relock the
set, allowing the items to be cleared and return the incorrect
notation `{}` for a empty set (it should be `set()`).
(cherry picked from commit a7427f2db9)
Co-authored-by: T. Wouters <thomas@python.org>
Co-authored-by: Yuki Kobayashi <drsuaimqjgar@gmail.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
gh-97850: Update the deprecation warning of `importlib.abc.Loader.load_module` (GH-129855)
(cherry picked from commit aa81a6f6e4)
Co-authored-by: Tomas R <tomas.roun8@gmail.com>
gh-126554: correct detection of `gcc` for `TestNullDlsym.test_null_dlsym` (GH-129872)
In case gcc is not available, the test will fail with FileNotFoundError.
So catch the exception to skip the test correctly.
(cherry picked from commit 978211c8a8)
Signed-off-by: Peter Marko <peter.marko@siemens.com>
Co-authored-by: Peter Marko <peter.marko@siemens.com>
gh-129892: Doc: Remove unnecessary role directive in graphlib.py (GH-129896)
Change `:exec:ValueError` to `ValueError` in `TopologicalSorter.done()` docstring
(cherry picked from commit c53730171f)
Co-authored-by: Nikola Savic <76233425+nikolasavic3@users.noreply.github.com>
gh-129873: IDLE: Improve help.py's method of parsing HTML (GH-129859)
In `help.copy_strip`, only copy the text `<section>`. In `help.HelpParser.handle_starttag` and elsewhere, remove code to skip the no longer present html. Add a reminder at the top of idle.rst to run copy_strip after changes.
---------
(cherry picked from commit 6fbf15f98e)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-129699: Add description to IDLE doc title (GH-129727)
Also extend the 'idlelib' section header. These additions affect both the displayed idle.html file and the contents.html file displayed by clicking the Complete table of contents link on the main docs.python.org page. (The module index entries are generated from the module name and synopsis within module files.)
---------
(cherry picked from commit 33a7094aa6)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
gh-64414: mention AF_INET6 and IPv6 in socketserver docs. (GH-129866)
mention AF_INET6 and IPv6 in socketserver docs.
(cherry picked from commit 5ce70ad129)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Found while running `test_load_attr_module` from `test_opcache` under TSan.
(cherry picked from commit 34379d0a59)
Co-authored-by: Sam Gross <colesbury@gmail.com>
The read of `shared->array` should happen under the lock to avoid a race.
(cherry picked from commit b4ff8b22b3)
Co-authored-by: Peter Hawkins <phawkins@google.com>
The MemoryError freelist was not thread-safe in the free threaded build.
Use a mutex to protect accesses to the freelist. Unlike other freelists,
the MemoryError freelist is not performance sensitive.
(cherry picked from commit 51b4edb1a4)
gh-112020: Rework socketserver examples to be correct.
Outdated code updated, the BaseRequestHandler example is now much more
illustrative instead of the bad idea of a single recv() call for TCP.
tested, they now work.
(cherry picked from commit 78377c788e)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Remove an inaccurate note from `socket.recv` (GH-129733)
Remove an inaccurate note from socket.recv.
(cherry picked from commit ded54c3baa)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Replace references to boilerplate files available in About IDLE and instead suggest clicking Help menu.
(cherry picked from commit d83a8a26f5)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Instead, anyone requesting credit should submit a PR with contribution summary.
(Also fix typo in existing name.)
(cherry picked from commit 76e0182948)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Test that the trailing pathname separator is preserved.
Multiple trailing pathname separators are only preserved if the pattern
does not contain metacharacters, otherwise only one trailing pathname
separator is preserved. This is rather an implementation detail.
(cherry picked from commit 8b5c8508c7)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-129502: Fix handling errors in ctypes callbacks (GH-129504)
Unlikely errors in preparing arguments for ctypes callback are now
handled in the same way as errors raised in the callback of in converting
the result of the callback -- using sys.unraisablehook() instead of
sys.excepthook() and not setting sys.last_exc and other variables.
(cherry picked from commit 9d63ae5fe5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-128696: Add arm64 to the get_platform return val description (GH-128701)
(cherry picked from commit 553cdc6d68)
Co-authored-by: RUANG (James Roy) <longjinyii@outlook.com>
gh-129407: Clarify that a `SystemError` isn't always CPython's fault (GH-129410)
(cherry picked from commit 39b754a359)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-127975: Avoid reusing quote types in ast.unparse if not needed (GH-127980)
(cherry picked from commit 8df5193d37)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>