Commit graph

115909 commits

Author SHA1 Message Date
Nikita Sobolev
e16922f070
[3.11] gh-109216: Fix possible memory leak in BUILD_MAP (#109323)
* [3.11] gh-109216: Fix possible memory leak in `BUILD_MAP`

* Add NEWS

* Update Python/ceval.c

Co-authored-by: Kumar Aditya <kumaraditya@python.org>

---------

Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2023-10-12 12:52:03 +00:00
Miss Islington (bot)
c9214b90f4
[3.11] gh-107450: Raise OverflowError when parser column offset overflows (GH-110754) (#110763)
(cherry picked from commit fb7843ee89)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-10-12 09:57:36 +00:00
Erlend E. Aasland
5178fb0b89
[3.11] GH-107518: Remove the Argument Clinic How-To (#109900) (#110761)
(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>
2023-10-12 09:52:59 +00:00
Miss Islington (bot)
f98903542c
[3.11] gh-110673: test_pty raises on short write (GH-110677) (#110743)
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>
2023-10-12 10:09:49 +02:00
Ezio Melotti
eb492d32b6
[3.11] gh-110631: Fix reST indentation in Doc/reference (GH-110708) (#110741)
Fix wrong indentation in the Doc/reference dir..
(cherry picked from commit 41d8ec5a1b)
2023-10-12 02:01:48 +02:00
Ezio Melotti
90b2620b6e
[3.11] gh-110631: Fix reST indentation (GH-110724) (#110739)
* Fix wrong indentation in the other dirs.

* Fix more wrong indentation..
(cherry picked from commit 718391f475)
2023-10-11 23:12:53 +02:00
Ezio Melotti
07471cda29
[3.11] gh-110631: Fix reST indentation in Doc/library (GH-110685) (#110737)
* [3.11] 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>

* Fix merge glitch.
2023-10-11 23:11:41 +02:00
Hugo van Kemenade
fd061a9bbe
[3.11] gh-108826: Document dis module CLI and rename _test function to main (#108827) (#110689)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2023-10-11 14:48:03 -06:00
Miss Islington (bot)
ad50415637
[3.11] gh-99834: Update macOS installer to Tcl/Tk 8.6.13. (GH-110710)
(cherry picked from commit 13e460086b)

Co-authored-by: Ned Deily <nad@python.org>
2023-10-11 21:42:24 +02:00
Miss Islington (bot)
79b81d1825
[3.11] gh-76106: Remove the cleanup lock in test_socket (GH-110539) (GH-110700)
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>
2023-10-11 11:13:06 +00:00
Ezio Melotti
a8b2d12a25
[3.11] gh-110631: fix wrong indentation in the Doc/whatsnew dir (GH-110632) (#110691)
fix wrong indentation in the `Doc/whatsnew` dir (#110632)
2023-10-11 03:53:26 -06:00
Miss Islington (bot)
c6d5628be9
[3.11] gh-110662: multiprocessing test_async_timeout() increase timeout (GH-110663) (#110675)
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>
2023-10-11 05:07:03 +02:00
Miss Islington (bot)
8ca7a230e7
[3.11] gh-110666: Fix multiprocessing test_terminate() elapsed (GH-110667) (#110669)
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>
2023-10-11 02:09:53 +00:00
Miss Islington (bot)
7984dc28b3
[3.11] gh-110656: Fix logging test_post_fork_child_no_deadlock() if ASAN (GH-110657) (#110665)
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>
2023-10-11 01:22:51 +00:00
Miss Islington (bot)
46347d3caf
[3.11] gh-110647: Fix signal test_stress_modifying_handlers() (GH-110650) (#110659)
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>
2023-10-11 00:21:51 +00:00
Erlend E. Aasland
a009bb872c
[3.11] gh-109286: Update Windows installer to use SQLite 3.43.1 (#110403) (#110479) 2023-10-11 00:41:12 +02:00
Miss Islington (bot)
28c6cc1928
[3.11] [3.12] gh-108303: Move all certificates to Lib/test/certdata/ (GH-109489) (GH-109682) (#110646)
[3.12] gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489) (GH-109682)

* gh-108303: Move all certificates to `Lib/test/certdata/` (GH-109489)
(cherry picked from commit e57ecf6bbc)

Python 3.12 backport: update also `test_nntplib`.

(cherry picked from commit c2d542b42c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: T. Wouters <thomas@python.org>
2023-10-10 21:02:21 +00:00
Miss Islington (bot)
4b67878daa
[3.11] gh-110631: Set three-space indents for reST in EditorConfig (GH-110635) (#110638)
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>
2023-10-10 15:03:11 +00:00
Serhiy Storchaka
3788c48d12
[3.11] gh-110388: Add tests for tty (GH-110394) (GH-110634)
(cherry picked from commit 7f702b2)
2023-10-10 16:27:22 +02:00
Miss Islington (bot)
f72b18d146
[3.11] Don't doubly-parallelise sphinx-lint (GH-110617) (#110627)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2023-10-10 07:00:24 -06:00
Miss Islington (bot)
e511f544ea
[3.11] gh-81002: Add tests for termios (GH-110386) (GH-110620)
(cherry picked from commit 92a9e98024)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-10 14:11:06 +02:00
Miss Islington (bot)
de62c2c1b3
[3.11] gh-101100: Fix sphinx warnings in library/socketserver.rst (GH-110207) (GH-110624)
(cherry picked from commit 756062b296)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-10-10 14:10:33 +02:00
Miss Islington (bot)
bf1753bb4c
[3.11] gh-110378: Fix test_async_gen_propagates_generator_exit in test_contextlib_async (GH-110500) (#110611)
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>
2023-10-10 13:12:40 +02:00
Miss Islington (bot)
7fefed091a
[3.11] gh-110590: Fix a bug where _sre.compile would overwrite exceptions (GH-110591) (#110614)
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>
2023-10-10 10:48:07 +00:00
Miss Islington (bot)
194272179d
[3.11] gh-78469: Declare missing sethostname for Solaris 10 (GH-109447) (#110581)
Add OS version specific macro for Solaris: Py_SUNOS_VERSION.
(cherry picked from commit 3b1580af07)

Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
2023-10-10 10:06:18 +00:00
Miss Islington (bot)
2b3a418279
[3.11] gh-110378: Close invalid generators in contextmanager and asynccontextmanager (GH-110499) (#110589)
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>
2023-10-10 11:12:52 +02:00
Miss Islington (bot)
d099defc63
[3.11] gh-109408: Add the docs whitespace check from patchcheck to pre-commit (GH-109854) (#110595)
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>
2023-10-10 08:36:28 +00:00
Miss Islington (bot)
2943bae7f1
[3.11] Add some 'meta hooks' to our pre-commit config (GH-110587) (#110600)
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>
2023-10-10 08:24:17 +00:00
Miss Islington (bot)
5ada51cd51
[3.11] Remove unused SPHINXLINT var from Doc/Makefile. (GH-110570) (#110584)
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>
2023-10-10 03:13:34 +02:00
Bo Anderson
9e9df93ffc
[3.11] gh-109191: Fix build with newer editline (gh-110239) (#110575)
(cherry picked from commit f4cb0d27cc)
2023-10-09 19:42:25 +00:00
Miss Islington (bot)
e913c6f4d6
[3.11] gh-110519: Improve deprecation warning in the gettext module (GH-110520) (GH-110564)
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>
2023-10-09 16:10:34 +02:00
Miss Islington (bot)
26c3e700b1
[3.11] gh-110437: Allow overriding VCRuntimeDLL with a semicolon separated list of DLLs to bundle (GH-110470)
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>
2023-10-09 11:42:57 +00:00
Miss Islington (bot)
b473d48505
[3.11] gh-109286: Update macOS installer to use SQLite 3.43.1 (GH-110482) (#110551)
(cherry picked from commit 48419a50b4)

Co-authored-by: jtranquilli <76231120+jtranquilli@users.noreply.github.com>
2023-10-09 12:31:27 +02:00
Miss Islington (bot)
6b63d40919
[3.11] gh-110497: Add note about OSError being an alias to IOError in docs (GH-110498) (#110545)
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>
2023-10-09 11:42:01 +02:00
Miss Islington (bot)
2bad6e715a
[3.11] gh-110534 fix a URL redirect to wikipedia article on Fibonacci numbers (GH-110535) (#110537)
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>
2023-10-09 04:55:37 +00:00
Miss Islington (bot)
f21c09ca03
[3.11] gh-110237: Check PyList_Append for errors in _PyEval_MatchClass (GH-110238) (#110512)
gh-110237: Check `PyList_Append` for errors in `_PyEval_MatchClass` (GH-110238)
(cherry picked from commit dd9d781da3)

Co-authored-by: denballakh <47365157+denballakh@users.noreply.github.com>
2023-10-08 00:29:46 +00:00
Miss Islington (bot)
af168df78f
[3.11] gh-109848: Make test_rot13_func in test_codecs independent (GH-109850) (GH-110505)
(cherry picked from commit b987fdb19b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-07 13:24:27 +00:00
Miss Islington (bot)
682321292f
[3.11] gh-109864: Make test_gettext tests order independent (GH-109866) (GH-110503)
(cherry picked from commit 1aad4fc5db)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-10-07 13:23:54 +00:00
Serhiy Storchaka
6a33529cf0
[3.11] gh-109521: Fix obscure cases handling in PyImport_GetImporter() (GH-109522) (GH-109781)
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)
2023-10-07 16:05:13 +03:00
Miss Islington (bot)
3d5aa7ec61
[3.11] Fix typo in Doc/library/textwrap.rst (GH-110328) (#110474)
Co-authored-by: InSync <122007197+InSyncWithFoo@users.noreply.github.com>
2023-10-06 14:35:23 +00:00
Miss Islington (bot)
49a45f6cd8
[3.11] gh-110184: Fix subprocess test_pipesize_default() (GH-110465) (#110472)
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>
2023-10-06 14:11:51 +00:00
Victor Stinner
88223f15d7
[3.11] Add support.MS_WINDOWS constant (#110446) (#110452) (#110464)
[3.12] Add support.MS_WINDOWS constant (#110446) (#110452)

Add support.MS_WINDOWS constant (#110446)

(cherry picked from commit e0c4437793)
(cherry picked from commit e188534607)
2023-10-06 10:19:49 +00:00
Miss Islington (bot)
4499e6caff
[3.11] gh-103053: Fix test_tools.test_freeze on FreeBSD (GH-110451) (#110457)
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>
2023-10-06 01:32:21 +00:00
Miss Islington (bot)
f7a1d7d060
[3.11] gh-103053: Fix make check-clean-src: check "python" program (GH-110449) (#110454)
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>
2023-10-06 01:10:39 +00:00
Miss Islington (bot)
67129c379c
[3.11] gh-109888: Fix test_os _kill_with_event() on Windows (GH-110421) (#110443)
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>
2023-10-05 22:06:28 +00:00
Miss Islington (bot)
4134036ce9
[3.11] gh-110393: Remove watchdog with hardcoded timeout (GH-110400) (#110444)
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>
2023-10-05 22:05:20 +00:00
Miss Islington (bot)
331d90f30b
[3.11] [3.12] gh-110167: Increase support.LOOPBACK_TIMEOUT to 10 seconds (GH-110413) (GH-110427) (#110440)
[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>
2023-10-05 23:10:01 +02:00
Miss Islington (bot)
779481ef15
[3.11] gh-110429: Fix race condition in "make regen-all" (GH-110433) (#110439)
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>
2023-10-05 20:49:32 +00:00
Miss Islington (bot)
a55c203104
[3.11] gh-110383: Swap 'the all' -> 'all the' in socket docs (GH-110434) (#110436)
Co-authored-by: Bradley Reynolds <bradley.reynolds@darbia.dev>
2023-10-05 14:14:32 -06:00
Miss Islington (bot)
a503bdf21f
[3.11] gh-109840: Fix multiprocessing test_waitfor_timeout() (GH-110428) (#110431)
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>
2023-10-05 19:53:14 +00:00