Commit graph

117424 commits

Author SHA1 Message Date
Miss Islington (bot)
77d9fdf23b
[3.12] gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106695)
gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106666)
(cherry picked from commit 357e9e9da3)

Co-authored-by: Prince Roshan <princekrroshan01@gmail.com>
2023-07-12 15:47:53 -07:00
Yonatan Bitton
ec7b05a0be
[3.12] gh-96747: Mention the PyPI passlib package in the crypt deprecation doc (GH-106660) (#106660)
* Added mention to passlib package as alternative to the deprecated crypt module.
2023-07-12 14:58:51 -07:00
Miss Islington (bot)
6de9cffcd3
[3.12] gh-99079: Update Windows build to use OpenSSL 3.0.9 (GH-106649) (#106680)
gh-99079: Update Windows build to use OpenSSL 3.0.9 (GH-106649)
(cherry picked from commit e2d7366fb3)

Co-authored-by: Steve Dower <steve.dower@python.org>
2023-07-12 16:30:52 +02:00
Miss Islington (bot)
af06a8ad4d
[3.12] gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213) (#106667)
gh-103186: In test_tools.freeze, fetch CONFIG_ARGS from original source directory (GH-103213)

Fetch CONFIG_ARGS from the original source directory, instead of from
the copied source tree. When "make clean" is executed in the copied
source tree, the build directory is cleared and the configure argument
lookup fails. However, the original source directory still contains this
information.
(cherry picked from commit de827322ca)

Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
2023-07-12 07:32:51 +00:00
Miss Islington (bot)
ae31599143
[3.12] Add Plausible for docs metrics (GH-106644) (#106661)
Add Plausible for docs metrics (GH-106644)
(cherry picked from commit e8ab0096a5)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-12 05:46:12 +03:00
Miss Islington (bot)
e248ba7b72
[3.12] gh-96165: Clarify passing ":memory:" in sqlite3.connect() (GH-106451) (#106647)
(cherry picked from commit f520804b03)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-07-11 22:31:48 +02:00
Miss Islington (bot)
bf7e92583d
[3.12] gh-96165: Clarify omitting the FROM clause in SQLite queries (GH-106513) (#106645)
(cherry picked from commit fc7ff1af45)

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-07-11 22:31:16 +02:00
Miss Islington (bot)
46a21f5c5e
[3.12] gh-102541: Add test case for help() for non_existent_module (GH-106340) (#106639)
gh-102541: Add test case for help() for non_existent_module (GH-106340)

Test fix for when one enters, for instance, 'abd' at the 'help>' prompt.
---------

(cherry picked from commit 292ac4bfe9)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-11 18:35:13 +00:00
Miss Islington (bot)
139e7ac7c2
[3.12] gh-106625 : Add missing code to tutorial 4.6 example (GH-106623) (#106636)
(cherry picked from commit d0b7e18262)

Co-authored-by: RustyNail <takonoyawarakaage@yahoo.co.jp>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-11 13:40:59 -04:00
Miss Islington (bot)
58f9c8889d
[3.12] gh-106403: Restore weakref support for TypeVar and friends (GH-106418) (#106635)
gh-106403: Restore weakref support for TypeVar and friends (GH-106418)
(cherry picked from commit 945d3cbf2e)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-07-11 16:15:30 +00:00
Thomas Wouters
60150590c7 Merge branch '3.12' of https://github.com/python/cpython into 3.12 2023-07-11 18:05:57 +02:00
Thomas Wouters
1336bb667b Post 3.12.0b4 2023-07-11 18:05:38 +02:00
Miss Islington (bot)
c594e25cd7
[3.12] gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627) (#106632)
gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627)

gh-86618 assumed a-b-c = a-(b+c) = a-d where d = b+d.
For floats 2.0, 1.0, and 0.9999999999999999, this assumption
is false.  The net change of 1.1102230246251565e-16 to 0.0
results in division by 0.  Revert the replacement.  Add test.
(cherry picked from commit a2d54d4e8a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-11 15:47:15 +00:00
Thomas Wouters
97a6a41816 Python 3.12.0b4 2023-07-11 14:23:30 +02:00
Miss Islington (bot)
6968f9e4d3
[3.12] gh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (GH-106468) (#106620)
gh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (GH-106468)

For example:

    class Flag(enum.Flag):
        A = 0x01
        B = 0x02
        MASK = 0xff

    ~Flag.MASK is Flag(0)
(cherry picked from commit 95b7426f45)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-07-11 14:09:41 +02:00
Miss Islington (bot)
2eb9fe92b4
[3.12] gh-103968: What's New: Add porting hints for PyType_From with metaclasses (GH-105698) (GH-106619)
gh-103968: What's New: Add porting hints for PyType_From with metaclasses (GH-105698)
(cherry picked from commit af5cf1e751)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-07-11 13:53:40 +02:00
Miss Islington (bot)
30870c834c
[3.12] gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API) (GH-105127) (#106612)
gh-102988: Detect email address parsing errors and return empty tuple to indicate the parsing error (old API) (GH-105127)

Detect email address parsing errors and return empty tuple to indicate the parsing error (old API). This fixes or at least ameliorates CVE-2023-27043.

---------

(cherry picked from commit 18dfbd0357)

Co-authored-by: Thomas Dwyer <github@tomd.tel>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-07-10 23:38:42 +00:00
Miss Islington (bot)
90ea3be6fb
[3.12] gh-94777: Fix deadlock in ProcessPoolExecutor (GH-94784) (#106609)
gh-94777: Fix deadlock in ProcessPoolExecutor (GH-94784)

Fixes a hang in multiprocessing process pool executor when a child process crashes and code could otherwise block on writing to the pipe.  See GH-94777 for more details.
(cherry picked from commit 6782fc0502)

Co-authored-by: Louis Paulot <55740424+lpaulot@users.noreply.github.com>
2023-07-10 22:49:07 +00:00
Miss Islington (bot)
68ca19061d
[3.12] gh-103186: Fix or catch 'extra' stderr output from unittests (GH-103196) (#106605)
gh-103186: Fix or catch 'extra' stderr output from unittests (GH-103196)

Reduce test noise by fixing or catching and testing stderr messages from individual tests.

test_cmd_line_script.test_script_as_dev_fd calls spawn_python and hence subprocess.Popen with incompatible arguments. On POSIX, pass_fds forces close_fds to be True (subprocess.py line 848). Correct the call.

test_uuid.test_cli_namespace_required_for_uuid3: when the namespace is omitted, uuid.main calls argparse.Argument_Parser.error, which prints to stderr before calling sys.exit, which raises SystemExit. Unittest assertRaises catches the exception but not the previous output. Catch the output and test it.

test_warnings.test_catchwarnings_with_simplefilter_error similarly prints before raising. Catch the output and test it.
---------

(cherry picked from commit 9d582250d8)

Co-authored-by: Ijtaba Hussain <ijtabahussain@live.com>
Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2023-07-10 21:03:32 +00:00
Serhiy Storchaka
2da967ea14
[3.12] gh-99593: Add tests for Unicode C API (part 3) (GH-104728) (GH-106595)
Add tests for codecs.
(cherry picked from commit 51ea664d18)
2023-07-10 20:58:58 +03:00
Miss Islington (bot)
41057b2ffe
[3.12] gh-105227: Add PyType_GetDict() (GH-105747) (#106600)
gh-105227: Add PyType_GetDict() (GH-105747)

This compensates for static builtin types having `tp_dict` set to `NULL`.

(cherry picked from commit a840806d33)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
Co-authored-by: Petr Viktorin <encukou@gmail.com>
2023-07-10 17:12:15 +00:00
Miss Islington (bot)
0481b805d6
[3.12] Clarify how topics.py gets created. (GH-106121) (#106579)
Clarify how topics.py gets created. (GH-106121)

When changing docs, it was easy to find text in topics.py, and I
wondered whether I was supposed to edit it.  Thankfully, the top of the
file says it's auto-generated, so I knew I didn't have to edit it. But I
didn't know what started the auto-generation process.

It's part of the release process, so I'll leave a note here for future
editors.
(cherry picked from commit dac1e36490)

Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
2023-07-09 20:42:22 -07:00
Miss Islington (bot)
128a962482
[3.12] gh-106461: typing: Consolidate docs on Callable (GH-106462) (#106574)
gh-106461: typing: Consolidate docs on `Callable` (GH-106462)
(cherry picked from commit ca8b55c7f5)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-09 22:21:54 +01:00
Miss Islington (bot)
559267fcd3
[3.12] Move implementation specific RE tests to separate class (GH-106563) (#106564)
Move implementation specific RE tests to separate class (GH-106563)
(cherry picked from commit 8cb6f9761e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-09 10:14:39 +00:00
Miss Islington (bot)
60ade0cb29
[3.12] gh-106510: Fix DEBUG output for atomic group (GH-106511) (GH-106548)
(cherry picked from commit 74ec02e949)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-08 15:15:54 +03:00
Miss Islington (bot)
48f58e0243
[3.12] gh-101880: add link to object.__hash__() in hash() builtin documentation (GH-101883) (#106546)
gh-101880: add link to object.__hash__() in hash() builtin documentation (GH-101883)
(cherry picked from commit ec7180bd1b)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2023-07-08 14:22:50 +05:30
Miss Islington (bot)
8fdb058793
[3.12] gh-106524: Fix a crash in _sre.template() (GH-106525) (GH-106544)
Some items remained uninitialized if _sre.template() was called with invalid
indices. Then attempt to clear them in the destructor led to dereferencing
of uninitialized pointer.
(cherry picked from commit 2ef1dc37f0)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2023-07-08 08:12:33 +00:00
Miss Islington (bot)
2ade2fc148
[3.12] gh-106300: Improve assertRaises(Exception) usages in tests (GH-106302) (GH-106534)
gh-106300: Improve `assertRaises(Exception)` usages in tests (GH-106302)
(cherry picked from commit 6e6a4cd523)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-07 14:25:24 -07:00
Miss Islington (bot)
7e883d76c0
[3.12] gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (GH-106504) (#106514)
gh-106503: asyncio._SelectorSocketTransport: fix cyclic reference on close(). (GH-106504)
(cherry picked from commit 3e5ce7968f)

Co-authored-by: Andrew Geng <pteromys@gmail.com>
2023-07-07 12:08:22 +00:00
Miss Islington (bot)
5293e01089
[3.12] closes gh-106479: fix typo in __cplusplus macro (gh-106480) (#106493)
closes gh-106479: fix typo in __cplusplus macro (gh-106480)
(cherry picked from commit 67a798888d)

Co-authored-by: Dustin Rodrigues <dust.rod@gmail.com>
2023-07-06 18:30:32 -05:00
Miss Islington (bot)
4787eaed06
[3.12] gh-90876: Restore the ability to import multiprocessing when sys.executable is None (GH-106464) (#106494)
gh-90876: Restore the ability to import multiprocessing when `sys.executable` is `None` (GH-106464)

Prevent `multiprocessing.spawn` from failing to *import* in environments
where `sys.executable` is `None`.  This regressed in 3.11 with the addition
of support for path-like objects in multiprocessing.

Adds a test decorator to have tests only run when part of test_multiprocessing_spawn to `_test_multiprocessing.py` so we can start to avoid re-running the same not-global-state specific test in all 3 modes when there is no need.
(cherry picked from commit c60df361ce)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-07-06 16:25:06 -07:00
Miss Islington (bot)
e229225fba
[3.12] Clarify state of CancelledError in doc (GH-106453) (#106454)
Clarify state of CancelledError in doc (GH-106453)

This change makes it explicit that asyncio.CancelledError is not a subclass of Exception.
(cherry picked from commit 12a9813808)

Co-authored-by: Kristján Valur Jónsson <sweskman@gmail.com>
2023-07-06 16:34:43 +05:30
Miss Islington (bot)
84cda268bd
[3.12] Doc: Add missing ref labels to exception groups/notes sections (GH-106465) (#106473)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-07-05 23:51:30 -06:00
Miss Islington (bot)
1e4c2359e4
[3.12] gh-105256: What's New note for comprehension over locals() (GH-106378) (#106471)
gh-105256: What's New note for comprehension over locals() (GH-106378)
(cherry picked from commit 13aefd175e)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-07-05 18:53:30 -06:00
Miss Islington (bot)
7b615a1573
[3.12] gh-106292: restore checking __dict__ in cached_property.__get__ (GH-106380) (#106469)
gh-106292: restore checking __dict__ in cached_property.__get__ (GH-106380)

* gh-106292: restore checking __dict__ in cached_property.__get__

(cherry picked from commit 838406b4fc)

Co-authored-by: Carl Meyer <carl@oddbird.net>
Co-authored-by: Dong-hee Na <donghee.na92@gmail.com>
2023-07-05 23:31:54 +00:00
Miss Islington (bot)
bb17e6f5de
[3.12] gh-105340: include hidden fast-locals in locals() (GH-105715) (#106470)
gh-105340: include hidden fast-locals in locals() (GH-105715)

* gh-105340: include hidden fast-locals in locals()
(cherry picked from commit 104d7b760f)

Co-authored-by: Carl Meyer <carl@oddbird.net>
2023-07-05 23:31:37 +00:00
Miss Islington (bot)
a49a29f22b
[3.12] shlex docs: remove outdated note (GH-106463) (#106466)
shlex docs: remove outdated note (GH-106463)

As the versionchanged notice says, this note is no longer true on 3.12+.
(cherry picked from commit c16ea94abc)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-07-05 13:57:49 -07:00
Erlend E. Aasland
b72601e7e5
[3.12] gh-64595: Fix regression in file write logic in Argument Clinic (#106449) (#106452)
Revert the two commits that introduced the regressions:

 - gh-104152
 - gh-104507

(cherry picked from commit 9d1d4f9c73)
2023-07-05 13:17:09 +00:00
Miss Islington (bot)
74d84cf84d
[3.12] gh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542) (#105572)
gh-105497: [Enum] Fix Flag inversion when alias/mask members exist. (GH-105542)

When inverting a Flag member (or boundary STRICT), only consider other canonical flags; when inverting an IntFlag member (or boundary KEEP), also consider aliases.
(cherry picked from commit 59f009e589)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2023-07-05 13:39:59 +02:00
Miss Islington (bot)
da672b2d24
[3.12] Document PYTHONSAFEPATH along side -P (GH-106122) (#106352)
Document PYTHONSAFEPATH along side -P (GH-106122)
(cherry picked from commit 0355625d94)

Co-authored-by: Jeremy Paige <ucodery@gmail.com>
2023-07-05 13:21:38 +02:00
Miss Islington (bot)
b314194c3c
[3.12] gh-105063: Disable test_peg_generator.TestCParser bco. ref leaks (GH-106024) (#106450)
Since gh-104798 (Use setuptools in peg-generator and reenable
tests), the TestCParser test case has been producing ref leaks.
(cherry picked from commit 41ad4dfc04)

Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2023-07-05 13:05:50 +02:00
Miss Islington (bot)
53605f285a
[3.12] GH-104554: Add RTSPS support to urllib/parse.py (GH-104605) (#105759)
RTSPS is the permanent scheme defined in
https://www.iana.org/assignments/uri-schemes/uri-schemes.xhtml
alongside RTSP and RTSPU schemes.

(cherry picked from commit f3266c05b6)

Co-authored-by: zentarim <33746047+zentarim@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2023-07-05 13:02:22 +02:00
Miss Islington (bot)
fc2393e417
[3.12] Display the sanitizer config in the regrtest header. (GH-105301) (#105342)
Display the sanitizer config in the regrtest header. (GH-105301)

Display the sanitizers present in libregrtest.

Having this in the CI output for tests with the relevant environment
variable displayed will help make it easier to do what we need to
create an equivalent local test run.
(cherry picked from commit 852348ab65)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-07-05 12:54:26 +02:00
Miss Islington (bot)
334b95b243
[3.12] gh-89392: Make test_decimal discoverable (GH-106209) (#106230)
gh-89392: Make test_decimal discoverable (GH-106209)
(cherry picked from commit 0e24499129)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-05 12:52:16 +02:00
Jeffery To
2edec6ad9f
[3.12] gh-104692: Include commoninstall as a prerequisite for bininstall (GH-104693) (#105428)
This ensures that `commoninstall` is completed before `bininstall` is
started when parallel builds are used (`make -j install`), and so the
`python3` symlink is only installed after all standard library modules
are installed.

(cherry picked from commit 990cb3676c)
2023-07-05 12:51:16 +02:00
Miss Islington (bot)
637102980d
[3.12] gh-100238: Use setuptools in peg-generator and reenable tests (GH-104798) (#105135)
(cherry picked from commit afa759fb80)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2023-07-05 11:42:47 +02:00
Miss Islington (bot)
00c522a81c
[3.12] gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443) (#106444)
gh-104683: Rename Lib/test/clinic.test as Lib/test/clinic.test.c (GH-106443)
(cherry picked from commit a941bd6c53)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-05 08:57:59 +00:00
Miss Islington (bot)
5784acd08c
[3.12] tp_flags docs: fix indentation (GH-106420) (#106442)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2023-07-04 23:12:47 -07:00
Miss Islington (bot)
6f684044a9
[3.12] gh-106368: Add tests for formatting helpers in Argument Clinic (GH-106415) (#106438)
gh-106368: Add tests for formatting helpers in Argument Clinic (GH-106415)
(cherry picked from commit 2fb9480c83)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-07-04 23:00:32 +00:00
Barney Gale
d5ed72b696
[3.12] GH-106330: Fix matching of empty path in pathlib.PurePath.match() (GH-106331) (GH-106372)
We match paths using the `_lines` attribute, which is derived from the
path's string representation. The bug arises because an empty path's string
representation is `'.'` (not `''`), which is matched by the `'*'` wildcard.
(cherry picked from commit b4efdf8cda)
2023-07-04 21:51:36 +01:00