(cherry picked from commit d1f7fae424)
* Remove the content of the Argument Clinic HOWTO
* Update cross-references to the Argument Clinic
* Add a note directing readers to the devguide
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
gh-110673: test_pty raises on short write (GH-110677)
Add write_all() helper function to test_pty to raise an exception on
short write: if os.writes() does not write all bytes. It should not
happen for a PTY.
(cherry picked from commit b4e8049766)
Co-authored-by: Victor Stinner <vstinner@python.org>
It does not already work (because it locks only addCleanup(), not doCleanups()),
and it is no longer needed since the clean up procedure waits for all test threads to join.
(cherry picked from commit f27b830907)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663)
Increase timeout from 1 second to 30 seconds, if not longer. The
important part is that apply_async() takes longer than TIMEOUT2.
(cherry picked from commit 790ecf6302)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667)
multiprocessing test_terminate() and test_wait_socket_slow() no
longer test the CI performance: no longer check maximum elapsed time.
Add CLOCK_RES constant: tolerate a difference of 100 ms.
(cherry picked from commit 1556f426da)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657)
Skip test_post_fork_child_no_deadlock() if Python is built with ASAN.
Add support.HAVE_ASAN_FORK_BUG.
(cherry picked from commit f901f56313)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650)
* cycle_handlers() now waits until at least one signal is received.
* num_received_signals can be equal to num_sent_signals.
(cherry picked from commit e07c37cd52)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-110631: Set three-space indents for reST in EditorConfig (GH-110635)
Set three-space indents in EditorConfig
(cherry picked from commit 66a9b10820)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
It now fails if the original bug is not fixed, and no longer produce ResourceWarning with fixed code.
(cherry picked from commit 5aa62a8de1)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
TypeError would be overwritten by OverflowError
if 'code' param contained non-ints.
(cherry picked from commit 344d3a222a)
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
contextmanager and asynccontextmanager context managers now close an invalid
underlying generator object that yields more then one value.
(cherry picked from commit 96fed66a65)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH-109854)
(cherry picked from commit 7426ed0347)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Add some 'meta hooks' to our pre-commit config (GH-110587)
(cherry picked from commit d5ec77fafd)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Remove unused `SPHINXLINT` var from `Doc/Makefile`. (GH-110570)
Remove unused `SPHINXLINT` var.
(cherry picked from commit bdbe43c7d0)
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Deprecation warning about non-integer numbers in gettext now always refers
to the line in the user code where gettext function or method is used.
Previously, it could refer to a line in gettext code.
Also, increase test coverage for NullTranslations and domain-aware functions
like dngettext().
(cherry picked from commit 326c6c4e07)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)
(cherry picked from commit 12cc6792d0)
Co-authored-by: Steve Dower <steve.dower@python.org>
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>
gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (GH-110535)
(cherry picked from commit 892ee72b36)
Co-authored-by: partev <petrosyan@gmail.com>
PyImport_GetImporter() now sets RuntimeError if it fails to get sys.path_hooks
or sys.path_importer_cache or they are not list and dict correspondingly.
Previously it could return NULL without setting error in obscure cases,
crash or raise SystemError if these attributes have wrong type.
(cherry picked from commit 62c7015e89)
gh-110184: Fix subprocess test_pipesize_default() (GH-110465)
For proc.stdin, get the size of the read end of the test pipe.
Use subprocess context manager ("with proc:").
(cherry picked from commit d023d4166b)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451)
Fix test_tools.test_freeze on FreeBSD: run "make distclean" instead
of "make clean" in the copied source directory to remove also the
"python" program.
Other test_freeze changes:
* Log executed commands and directories, and the current directory.
* No longer uses make -C option to change the directory, instead use
subprocess cwd parameter.
(cherry picked from commit a4baa9e8ac)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-103053: Fix make check-clean-src: check "python" program (GH-110449)
"make check-clean-src" now also checks if the "python" program is
found in the source directory: fail with an error if it does exist.
(cherry picked from commit a155f9f342)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421)
Replace os.kill() with proc.kill() which catchs PermissionError.
Rewrite _kill_with_event():
* Use subprocess context manager ("with proc:").
* Use sleeping_retry() to wait until the child process is ready.
* Replace SIGINT with proc.kill() on error.
* Replace 10 seconds with SHORT_TIMEOUT to wait until the process is
ready.
* Replace 0.5 seconds with SHORT_TIMEOUT to wait for the process
exit.
(cherry picked from commit aaf297c048)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-110393: Remove watchdog with hardcoded timeout (GH-110400)
test_builtin and test_socketserver no longer use signal.alarm() to
implement a watchdog with a hardcoded timeout (2 and 60 seconds).
Python test runner regrtest has two watchdogs: faulthandler and
timeout on running worker processes. Tests using short hardcoded
timeout can fail on slowest buildbots just because the timeout is too
short.
(cherry picked from commit 1328fa31fe)
Co-authored-by: Victor Stinner <vstinner@python.org>
[3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) (GH-110427)
gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413)
Increase support.LOOPBACK_TIMEOUT from 5 to 10 seconds. Also increase
the timeout depending on the --timeout option. For example, for a
test timeout of 40 minutes (ARM Raspbian 3.x), use LOOPBACK_TIMEOUT
of 20 seconds instead of 5 seconds before.
(cherry picked from commit 350d89b795)
Co-authored-by: Victor Stinner <vstinner@python.org>
(cherry picked from commit 0db2f1475e)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-110429: Fix race condition in "make regen-all" (GH-110433)
"make regen-pegen" now creates a temporary file called "parser.c.new"
instead of "parser.new.c". Previously, if "make clinic" was run in
parallel with "make regen-all", clinic may try but fail to open
"parser.new.c" if the temporay file was removed in the meanwhile.
(cherry picked from commit fb6c4ed2bb)
Co-authored-by: Victor Stinner <vstinner@python.org>
gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428)
Don't measure the CI performance: don't fail if cond.wait_for() takes
longer than 1 second on a slow CI.
(cherry picked from commit 5eae8dc2cb)
Co-authored-by: Victor Stinner <vstinner@python.org>