gh-140193: Forward port test_exec_set_nomemory_hang from 3.13 (GH-140187)
* chore: test_exec_set_nomemory_hang from 3.13
* fix: apply comments
* Update Lib/test/test_exceptions.py
* Update Lib/test/test_exceptions.py
* fix: windows too long name 60 times is enough
---------
(cherry picked from commit 0f09bda643)
Signed-off-by: yihong0618 <zouzou0208@gmail.com>
Co-authored-by: yihong <zouzou0208@gmail.com>
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
gh-139533: fix refs to code without proper markups on turtledemo doc (GH-139534)
(cherry picked from commit c903d76832)
gh-139533: fix refs to code without proper markups on turtledemo documentation
Co-authored-by: Marco Barbosa <aureliobarbosa@gmail.com>
gh-140379: add hyperlinks to list and set (GH-140399)
add hyperlinks to list and set
(cherry picked from commit 92741c59f8)
Co-authored-by: Krishna Chaitanya <141550576+XChaitanyaX@users.noreply.github.com>
gh-140578: Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist (GH-140689)
* Doc: Remove sencence implying that concurrent.futures.ThreadPoolExecutor does not exist
Closes GH-140578
* Add NEWS.d entry for gh-140578
---------
(cherry picked from commit 46b58e1bb9)
Co-authored-by: Louis <paternal@users.noreply.github.com>
Co-authored-by: Louis Paternault <spalax@gresille.org>
gh-141174: Improve `annotationlib._Stringifier` test coverage (GH-141220)
* Test `_Stringifier.__convert_to_ast()` for containers
* Test partial evaluation of `ForwardRef`s in `_Stringifier`
(cherry picked from commit 55ea132313)
Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
gh-141174: Improve `ForwardRef` test coverage (GH-141175)
* Test unsupported format in ForwardRef.evaluate()
* Test dict cell closure with multiple variables
* Test all options in ForwardRef repr
* Test ForwardRef being a final class
(cherry picked from commit 19b573025e)
Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
gh-141174: Improve `annotationlib.call_annotate_function()` test coverage (GH-141176)
* Test passing unsupported Format values to call_annotate_function()
* Test call_evaluate_function with fake globals that raise errors
* Fix typo and comparison in test_fake_global_evaluation
(cherry picked from commit 1110e8f6a4)
Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
gh-141174: Improve `annotationlib.get_annotations()` test coverage (GH-141286)
* Test `get_annotations(format=Format.VALUE)` for stringized annotations on custom objects
* Test `get_annotations(format=Format.VALUE)` for stringized annotations on wrapped partial functions
* Update test_stringized_annotations_with_star_unpack() to actually test stringized annotations
* Test __annotate__ returning a non-dict
* Test passing globals and locals to stringized `get_annotations()`
(cherry picked from commit 06b62282c7)
Co-authored-by: dr-carlos <77367421+dr-carlos@users.noreply.github.com>
(cherry picked from commit d2ce6d708a)
Co-authored-by: Petr Viktorin <encukou@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Emma Smith <emma@emmatyping.dev>
Co-authored-by: Author: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Karina Souza <97332018+KarinaS0uza@users.noreply.github.com>
Co-authored-by: Joseph Anthony Pasquale Holsten <joseph@josephholsten.com>
gh-62480: De-personalize "Partial mocking" section in `unittest.mock` examples (GH-141321)
* Refine some wording in unittest partial mock doc
Some of the descriptions were addressed in first person,
but have now been changed to address the user reading the documentation instead.
(cherry picked from commit b618731781)
Co-authored-by: KarnbirKhera <166065758+KarnbirKhera@users.noreply.github.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
gh-140980: document `SET_FUNCTION_ATTRIBUTE` flag for `annotate` function (GH-141306)
(cherry picked from commit 6f20ea1e2d)
Co-authored-by: Lakshya Upadhyaya <lakshya.upadhyaya05@gmail.com>
gh-140530: fix a reference leak in an error path for `raise exc from cause` (GH-140908)
Fix a reference leak in `raise E from T` when `T` is an exception
subtype for which `T.__new__` does not return an exception instance.
(cherry picked from commit 0c77e7c23b)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-141004: document `curses` C API (GH-141254)
(cherry picked from commit dbe40904a7)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-100218: correctly set `errno` when `socket.if_{nametoindex,indextoname}` raise `OSError` (GH-140905)
Previously, socket.if_nametoindex() and socket.if_indextoname() could raise
an `OSError` with a `None` errno. Now, the errno from libc is propagated.
(cherry picked from commit 3ce2d57b2f)
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
gh-141004: Document the `PyDoc_VAR` macro (GH-141263)
(cherry picked from commit 545299773b)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
gh-141004: Document `PyErr_ProgramTextObject` and `PyErr_ProgramText` (GH-141250)
(cherry picked from commit be1c72a45d)
Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
gh-141246: Link to correct Windows docs in `time.sleep()` doc (GH-141248)
(cherry picked from commit 6545a4e8f8)
Co-authored-by: 莯凛 <1348292515@qq.com>
* Refer to bytes objects or bytes-like objects instead of strings.
* Remove backticks -- they do not have effect on formatting.
* Re-wrap lines to ensure the pydoc output fits in 80 columns.
(cherry picked from commit 610377056b)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Document that ensure_ascii=True forces escaping not only non-ASCII, but also
non-printable characters (the only affected ASCII character is U+007F).
* Ensure that the help output for the json module does not exceed 80
columns (except one long line in an example and generated lines).
* Add more tests.
(cherry picked from commit 7e90bac3cc)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Update NaNs handling description in `c-api/float.rst` (GH-141179)
Clarified the behavior of NaNs on IEEE platforms regarding signaling and quiet NaNs.
(cherry picked from commit 920286d6b2)
Co-authored-by: W. H. Wang <mattwang44@gmail.com>