Add a guide for how to handle non-UTF-8 text encodings.
Link to that guide from the 'text_factory' docs.
(cherry picked from commit 1262e41842)
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
Co-authored-by: Corvin <corvin@corvin.dev>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Fix first parameter name in `tool` functions from `sys.monitoring` (GH-111286)
(cherry picked from commit 8b44f3c54b)
Co-authored-by: Pavel Karateev <lancelote.du.lac@gmail.com>
Revert "Fix a code snippet typo in asyncio docs (GH-108427)" (GH-111271)
This reverts commit 7f31676340.
The change resulted in a tautology and should not have been made. There
may be an opportunity for additional clarity in this section, but this
change wasn't it :)
(cherry picked from commit c7d68f907a)
Ref: https://github.com/python/cpython/pull/108427#-issuecomment-1777525740
Co-authored-by: Zachary Ware <zach@python.org>
gh-101100: Fix Sphinx warnings in `library/tty.rst` (GH-111079)
Fix Sphinx warnings in library/tty.rst
(cherry picked from commit c42c68aa7b)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
gh-110631: Fix reST indentation in `Doc/library` (GH-110685)
Fix wrong indentation in the Doc/library dir.
(cherry picked from commit bb7923f556)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
gh-110497: Add note about `OSError` being an alias to `IOError` in docs (GH-110498)
(cherry picked from commit 5e7edac771)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Add back bltin-boolean-values ref tag (GH-110371)
To avoid breaking downstream intersphinx via numpydoc
(cherry picked from commit f7860295b1)
Co-authored-by: P. L. Lim <2090236+pllim@users.noreply.github.com>
gh-85984: Document change in return type of tty functions (GH-110028)
(cherry picked from commit f02f26e293)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Enhance TypedDict docs around required/optional keys (GH-109547)
As discussed in comments to GH-109544, the semantics of this attribute
are somewhat confusing. Add a note explaining its limitations and
steering users towards __required_keys__ and __optional_keys__ instead.
(cherry picked from commit f49958c886)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
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>