gh-111380: Show SyntaxWarnings only once when parsing if invalid syntax is encouintered (GH-111381)
(cherry picked from commit 3d2f1f0b83)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
gh-111347: Remove wrong assertion in test_sendfile (GH-111377)
Windows is different.
(cherry picked from commit fa35b9e89b)
Co-authored-by: zcxsythenew <30565051+zcxsythenew@users.noreply.github.com>
CI: Include Python version in cache.config key (GH-111410)
* Include Python version in cache.config key, after Python setup
* Remove EOL 3.7 from branch triggers
(cherry picked from commit 9d4a1a480b)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
- `ThreadedChildWatcher.close()` is now *officially* a no-op; `_join_threads()` never did anything.
- Threads created by that class are now named `asyncio-waitpid-NNN`.
- `test.test_asyncio.utils.TestCase.close_loop()` now waits for the child watcher's threads, but not forever; if a thread hangs, it raises `RuntimeError`.
(cherry picked from commit c3bb10c930)
Co-authored-by: Guido van Rossum <guido@python.org>
Fix locale.LC_CTYPE documentation to no longer mention string.lower() et al. Those functions were removed in Python 3.0:
https://docs.python.org/2/library/string.htmlGH-deprecated-string-functions
Also, fix a comment in logging about locale-specific behavior of `str.lower()`.
(cherry picked from commit 6d42759c5e)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
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>
Remove no longer used functions run_unittest() and run_doctest() from
the test.support module.
(cherry picked from commit f6a45a03d0)
(cherry picked from commit 5c4f9a1c7e)
* use unittest.main() instead of run_unittest(test_suite()) to run tests from
modules via the CLI
* add explicit load_tests() to load doctests
* use test.support.load_package_tests() to load tests in submodules of
distutils.tests
* removes no longer needed test_suite() functions
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>
asyncio.TaskGroup and asyncio.Timeout classes now raise proper RuntimeError
if they are improperly used.
* When they are used without entering the context manager.
* When they are used after finishing.
* When the context manager is entered more than once (simultaneously or
sequentially).
* If there is no current task when entering the context manager.
They now remain in a consistent state after an exception is thrown,
so subsequent operations can be performed correctly (if they are allowed).
(cherry picked from commit 6c23635f2b)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: James Hilton-Balfe <gobot1234yt@gmail.com>
Test case matching patterns specified by options --match, --ignore,
--matchfile and --ignorefile are now tested in the order of
specification, and the last match determines whether the test case be run
or ignored.
(cherry picked from commit 9a1fe09622)
gh-110932: Fix regrtest for SOURCE_DATE_EPOCH (GH-111143)
If the SOURCE_DATE_EPOCH environment variable is defined, use its
value as the random seed.
(cherry picked from commit 7237fb578d)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-111126: Use `isinstance` instead of `assert[Not]IsInstance` in `test_typing` (GH-111127)
(cherry picked from commit ea7c26e4b8)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
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>