gh-109590: Update shutil.which on Windows to prefer a PATHEXT extension on executable files (GH-109995)
The default arguments for shutil.which() request an executable file, but extensionless files are not executable on Windows and should be ignored.
(cherry picked from commit 29b875bb93)
Co-authored-by: Charles Machalow <csm10495@gmail.com>
* gh-109649: Enhance os.cpu_count() documentation
* Doc: Specify that os.cpu_count() counts *logicial* CPUs.
* Doc: Specify that os.sched_getaffinity(0) is related to the calling
thread.
* Fix test_posix.test_sched_getaffinity(): restore the old CPU mask
when the test completes!
* Restore removed text
Add example for linear_regression() with proportional=True. (gh-110133)
(cherry picked from commit 613c0d4e86)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
gh-108973: Fix asyncio test_subprocess_consistent_callbacks() (GH-109431)
SubprocessProtocol process_exited() method can be called before
pipe_data_received() and pipe_connection_lost() methods. Document it
and adapt the test for that.
Revert commit 282edd7b2a.
_child_watcher_callback() calls immediately _process_exited(): don't
add an additional delay with call_soon(). The reverted change didn't
make _process_exited() more determistic: it can still be called
before pipe_connection_lost() for example.
(cherry picked from commit ced6924630)
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Davide Rizzo <sorcio@gmail.com>
GH-92584: Move installation schemes overview to sysconfig docs (GH-108018)
* Add new installation path functions subsection
* Add content from install/index to sysconfig
* Fix table
* Update note about installers
* Clean up the list of schemes, remove references to Distutils
(cherry picked from commit f16e81f368)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
* gh-100228: Document the os.fork threads DeprecationWarning. (GH-109767)
Document the `os.fork` posix threads detected `DeprecationWarning` in 3.12 What's New, os, multiprocessing, and concurrent.futures docs.
Many reviews and doc cleanup edits by Adam & Hugo. 🥳
(cherry picked from commit 5e7ea95d9d)
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
* link to the discussion thread from whatsnew
Include the link to the discussion in the what's new text per @malemberg's comment on. https://github.com/python/cpython/pull/109767
(i'll follow up with a PR to main to include this edit there as well)
---------
Co-authored-by: Gregory P. Smith <greg@krypto.org>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-109414: Add some basic information about venvs in the introduction. (GH-109440)
(cherry picked from commit a6846d45ff)
Co-authored-by: Vinay Sajip <vinay_sajip@yahoo.co.uk>
Co-authored-by: Victor Stinner <vstinner@python.org>
Docs: Superseded modules: list only module names (GH-109439)
(cherry picked from commit b434dd7e36)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Fix variable name in dis documentation example (GH-109343)
BINARY_SUBSCR example erroneously uses two different names `key` and `index` to refer to the same variable. STORE_SUBSCR and DELETE_SUBSCR use only `key` in the same context. Changing `index` to `key` for consistency.
(cherry picked from commit a0c06a4f93)
Co-authored-by: Oleksandr Kravets <73752159+olekskrav@users.noreply.github.com>
gh-105189: fix importlib.resources.abc deprecation docs (GH-105232)
(cherry picked from commit 6c0ddca409)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Fix iter_index() to work with lists which do not support stop=None. (gh-109306)
(cherry picked from commit f2a55fecd0)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Improve the sieve() recipe in the itertools docs (gh-109199)
Lazier sieve
(cherry picked from commit d3ed9921cd)
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
Add version directives to ast docs (GH-108788)
(cherry picked from commit 74fc96bc60)
Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
gh-107924: re-order os.sendfile() flag documentation (GH-107926)
(cherry picked from commit 403ab1306a)
Co-authored-by: Christoph Anton Mitterer <mail@christoph.anton.mitterer.name>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-102823: Document return type of floor division on floats (GH-102824)
(cherry picked from commit b72251de93)
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
socket documentation fix - rename triple to 3-tuple (GH-24722)
(cherry picked from commit 6b15ff5235)
Co-authored-by: Ori Hoch <ori@uumpa.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-71770: Add more details on behavior of configparser's default_section (GH-31562)
(cherry picked from commit 891236f482)
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
bpo-38157: Add example about per file output for mock_open. (GH-16090)
(cherry picked from commit e183a71eef)
Co-authored-by: Karthikeyan Singaravelan <tir.karthi@gmail.com>
Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-107755: Document the correct default value of slice step (GH-107756)
Document the correct default value of slice step.
(cherry picked from commit 9bf350b066)
Co-authored-by: wim glenn <hey@wimglenn.com>
gh-107732: Mention dir support in importlib.resources docs (#107734)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
(cherry picked from commit 9f0c0a46f0)
Co-authored-by: Shahriar Heidrich <smheidrich@weltenfunktion.de>
GH-108202: Document ``calendar``'s command-line interface (GH-109020)
(cherry picked from commit f0f96a9f40)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-107208: Fix iter_index() recipe to not swallow exceptions (gh-108835)
(cherry picked from commit f373c6b948)
gh-107208: iter_index now supports "stop" and no longer swallows ValueError
Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
`ast` docs: Fix incorrect link on `keyword` (GH-108728)
In two places, Sphinx was erroneously adding links to the `keyword` module instead of the `ast.keyword` class
(cherry picked from commit c1e2f3b2f7)
Co-authored-by: Alex Povel <git@alexpovel.de>