Commit graph

115471 commits

Author SHA1 Message Date
Łukasz Langa
c65ca7097a
[3.11] Reformat code block to make it easier to read (GH-106965) (#107022)
(cherry picked from commit ed491d9f78)

Co-authored-by: Joe Kaufeld <opensource@joekaufeld.com>
2023-07-22 16:14:24 +02:00
Oliver Rew
a7a973e9c7
[3.11] gh-100700 Remove Date and Release fields in past whatsnews (GH-100728) (#106999)
Co-authored-by: Zachary Ware <zach@python.org>
2023-07-22 12:43:43 +00:00
Łukasz Langa
06f8a43995
[3.11] gh-106368: Increase coverage for Argument Clinic output directive (GH-106979) (#107002)
(cherry picked from commit ee5c01b473)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-22 14:15:18 +02:00
Sebastiaan Zeeff
4f7c23e4df
[3.11] Change non-integral to non-integer in random docs (GH-106975) (#106985) 2023-07-22 02:37:16 -06:00
Serhiy Storchaka
b338ac7540
[3.11] gh-106909: Use role :const: for referencing module constants (GH-106910) (GH-106957)
(cherry picked from commit 4b9948617f)
2023-07-21 14:49:57 +03:00
Serhiy Storchaka
cc76113cf8
[3.11] gh-106892: Use roles :data: and :const: for referencing module variables (GH-106894) (GH-106955)
(cherry picked from commit d036db728e)
2023-07-21 14:49:21 +03:00
Serhiy Storchaka
6bde1b9f04
[3.11] gh-106919: Use role :c:macro: for referencing the C "constants" (GH-106920) (GH-106952)
(cherry picked from commit fcc816dbff)
2023-07-21 14:48:30 +03:00
Miss Islington (bot)
0a57620887
[3.11] Docs: Argument Clinic: Add Background and Tutorial top-level sections (GH-106904) (#106946)
Add Background as a toplevel section with the following subsections:

- Background
  - The goals of Argument Clinic
  - Basic concepts and usage

Rename "Converting your first function" to Tutorial.

Add anchors for Background, Tutorial, and How-to Guides:

- :ref:`clinic-background`
- :ref:`clinic-tutorial`
- :ref:`clinic-howtos`

Link to these from within the Abstract.

Break the compatibility paragraph out of Abstract and make it a note.
(cherry picked from commit 81861fd90b)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-21 08:32:56 +02:00
Miss Islington (bot)
951b08c500
[3.11] gh-106368: Increase Argument Clinic test coverage for IndentStack (GH-106933) (#106944)
(cherry picked from commit 8d228cf66f)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-21 06:31:00 +00:00
Miss Islington (bot)
a5c8d240c0
[3.11] Fix typo in tkinter docs (GH-106936) (#106938)
Fix typo in tkinter docs (GH-106936)
(cherry picked from commit 60e83968d5)

Signed-off-by: Makonede <61922615+Makonede@users.noreply.github.com>
Co-authored-by: Makonede <61922615+Makonede@users.noreply.github.com>
2023-07-21 00:12:00 +01:00
Miss Islington (bot)
a6313d78f2
[3.11] gh-106882: Note that asyncio.Server is only publicly exposed on 3.11+ (GH-106901) (#106903)
gh-106882: Note that `asyncio.Server` is only publicly exposed on 3.11+ (GH-106901)

And later versions of 3.10, 3.9
(cherry picked from commit 1e1f4e91a9)

Co-authored-by: Jack Nelson <jack@jacknelson.xyz>
2023-07-19 21:03:44 +01:00
Serhiy Storchaka
fced79f91e
[3.11] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855) (GH-106863)
[3.11] [3.12] gh-86493: Fix possible leaks in some modules initialization (GH-106768) (GH-106855)

Fix _ssl, _stat, _testinternalcapi, _threadmodule, cmath, math, posix, time.
(cherry picked from commit 3e65baee72).
(cherry picked from commit a423ddbdea)
2023-07-19 09:40:38 +03:00
Miss Islington (bot)
0c47ed7bbf
[3.11] Docs: Argument Clinic: Group guides about default values (GH-106872) (#106873)
Docs: Argument Clinic: Group guides about default values (GH-106872)

Previous ToC layout (excerpt):

    - How to use symbolic default values
    ...
    - How to assign default values to parameter
      - How to use the ``NULL`` default value
      - How to use expressions as default values

New layout:

    - How to assign default values to parameter
      - The ``NULL`` default value
      - Symbolic default values
      - Expressions as default values

(cherry picked from commit 505eede38d)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-19 01:16:04 +02:00
Miss Islington (bot)
38553442c8
[3.11] Docs: Normalise Argument Clinic advanced topics headings (GH-106842) (#106852)
(cherry picked from commit 4cb0b9c0a9)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
2023-07-18 12:25:25 +02:00
Serhiy Storchaka
3841af49e5
[3.11] gh-86493: Fix possible leaks in modules initialization: _curses_panel, _decimal, posix, xxsubtype (GH-106767) (GH-106849) (GH-106851)
(cherry picked from commit 745492355b)
(cherry picked from commit 970cb8eaba)
2023-07-18 12:53:17 +03:00
Serhiy Storchaka
fb04874053
[3.11] gh-106719: Fix __annotations__ getter and setter in the type and module types (GH-106720) (GH-106850)
No longer suppress arbitrary errors. Simplify the code.
(cherry picked from commit e1c295e3da)
2023-07-18 10:19:45 +03:00
Miss Islington (bot)
a7acc5cb5c
[3.11] gh-106368: Increase Argument Clinic test coverage for cpp.Monitor (GH-106833) (#106839)
(cherry picked from commit 22379c60ab)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-17 21:22:43 +00:00
Miss Islington (bot)
a782d51913
[3.11] gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (GH-106832) (#106836)
gh-106831: Fix NULL check of d2i_SSL_SESSION() result in _ssl.c (GH-106832)
(cherry picked from commit ebf2c56b33)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-17 20:31:10 +00:00
Zachary Ware
263d8aa017
[3.11] gh-99079: Update Windows build to use OpenSSL 3.0.9 (GH-106649) (GH-106761)
Co-authored-by: Steve Dower <steve.dower@python.org>
2023-07-17 12:07:52 -05:00
Miss Islington (bot)
6193f783d0
[3.11] gh-106780: Add __match_args__ to tutorial example (GH-106784) (#106820)
Add Point definition with this attribute before example
that needs it.
(cherry picked from commit 7aa89e505d)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-17 04:15:52 -04:00
Miss Islington (bot)
9532f0e6dd
Doc: fix section levels of devmode doc (GH-106801)
Doc: fix section levels of devmode doc (GH-106801)
(cherry picked from commit e58960160f)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2023-07-16 21:27:51 +09:00
Inada Naoki
77104f5511
Doc: devmode: add -Xdev option to example (GH-106253)
(cherry picked from commit 83bd568d2b)

Co-authored-by: Simone Rubino <daemo00@gmail.com>
2023-07-16 11:43:56 +00:00
Miss Islington (bot)
501178ac9d
[3.11] Docs search: Replace jQuery with vanilla JavaScript (GH-106743) (#106803)
Docs search: Replace jQuery with vanilla JavaScript (GH-106743)

* Replace jQuery with vanilla JavaScript
* Switch 'var' to 'const' or 'let'
(cherry picked from commit c02ee45031)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-07-16 11:38:46 +03:00
Miss Islington (bot)
9aeb9d1e80
wasm: do not use inline comment in .editorconfig (GH-106610)
It is no longer valid since 0.15.0
https://github.com/editorconfig/specification/blob/v0.15/index.rstGH-no-inline-comments
(cherry picked from commit 64c0890b69)

Co-authored-by: Eisuke Kawashima <e-kwsm@users.noreply.github.com>
2023-07-16 16:03:24 +09:00
Miss Islington (bot)
c73f9c045e
[3.11] Docs: Normalize Argument Clinic How-To section capitalization (GH-106788) (#106792)
(cherry picked from commit 8c17729489)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-16 00:50:43 +02:00
Jason R. Coombs
465f5b09df
[3.11] gh-106752: Sync with zipp 3.16.2 (GH-106757) (#106778)
* gh-106752: Sync with zipp 3.16.2 (#106757)

* gh-106752: Sync with zipp 3.16.2

* Add blurb

(cherry picked from commit 22980dc7c9)

* [3.11] gh-106752: Sync with zipp 3.16.2 (GH-106757)

* gh-106752: Sync with zipp 3.16.2

* Add blurb.
(cherry picked from commit 22980dc7c9)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>

* Remove Python 3.12 concerns from changelog.
2023-07-15 10:15:38 -04:00
Alex Waygood
7dead6a33a
[3.11] gh-106745: typing docs: Clarify that removal of PEP-585 aliases is not currently planned (#106748) (#106773) 2023-07-15 11:34:29 +01:00
Miss Islington (bot)
b132b77fb1
[3.11] gh-106368: Increase Argument Clinic BlockParser test coverage (GH-106759) (#106770)
(cherry picked from commit 2d7d1aa4bc)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2023-07-15 09:48:01 +00:00
Dennis Sweeney
d488970ae6
[3.11] gh-105235: Prevent reading outside buffer during mmap.find() (… (#106710)
[3.11] gh-105235: Prevent reading outside buffer during mmap.find() (GH-105252)

* Add a special case for s[-m:] == p in _PyBytes_Find

* Add tests for _PyBytes_Find

* Make sure that start <= end in mmap.find.
(cherry picked from commit ab86426a34)
2023-07-14 22:17:09 -04:00
Terry Jan Reedy
2186212191
[3.11] gh-106446: Fix failed doctest in stdtypes (GH-106447) (#106742)
(cherry picked from commit 89867d2491)

Co-authored-by: Charlie Zhao <zhaoyu_hit@qq.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-07-14 04:02:25 -04:00
Erlend E. Aasland
d22224a401
[3.11] gh-106368: Increase Argument Clinic test coverage (#106728) (#106731)
- improve output_parameter() coverage
- improve coverage for Function.kind

(cherry picked from commit ec45c513d3)

Co-authored-by: Erlend E. Aasland <erlend@python.org>

* Fix merge
2023-07-14 01:13:43 +02:00
Miss Islington (bot)
a276ce4505
[3.11] gh-106602: [Enum] Add __copy__ and __deepcopy__ (GH-106694)
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:48:16 -07:00
Miss Islington (bot)
eac0616df9
[3.11] [3.12] gh-96747: Mention the PyPI passlib package in the crypt deprecation doc (GH-106660) (GH-106660) (#106697)
[3.12] gh-96747: Mention the PyPI `passlib` package in the `crypt` deprecation doc (GH-106660) (GH-106660)

* Added mention to passlib package as alternative to the deprecated crypt module.
(cherry picked from commit ec7b05a0be)

Co-authored-by: Yonatan Bitton <bityob@gmail.com>
2023-07-12 14:59:54 -07:00
Miss Islington (bot)
81a5bcf7ba
[3.11] Add Plausible for docs metrics (GH-106644) (#106662)
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:45:23 +03:00
Miss Islington (bot)
247f0500b8
[3.11] gh-96165: Clarify passing ":memory:" in sqlite3.connect() (GH-106451) (#106648)
cherry picked from commit f520804b03)

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

Co-authored-by: Mariusz Felisiak <felisiak.mariusz@gmail.com>
2023-07-11 22:30:52 +02:00
Miss Islington (bot)
3e61e20043
[3.11] gh-102541: Add test case for help() for non_existent_module (GH-106340) (#106640)
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:28:28 +00:00
Miss Islington (bot)
549b528abe
[3.11] gh-106625 : Add missing code to tutorial 4.6 example (GH-106623) (#106637)
(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:17 -04:00
Miss Islington (bot)
da15b12d8d
[3.11] gh-106498: Revert incorrect colorsys.rgb_to_hls change (GH-106627) (#106633)
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:48:00 +00:00
Miss Islington (bot)
318f6ae1cd
[3.11] gh-105497: [Enum] Fix flag mask inversion when unnamed flags exist (GH-106468) (#106621)
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:10:02 +02:00
Miss Islington (bot)
d63953d0f5
[3.11] gh-94777: Fix deadlock in ProcessPoolExecutor (GH-94784) (#106607)
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 16:21:04 -06:00
Terry Jan Reedy
563829df55
[3.11] gh-103186: Fix or catch 'extra' stderr output from unittests (#103196) (#106606)
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.
---------

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
(cherry picked from commit 9d582250d8)
2023-07-10 21:13:26 +00:00
Miss Islington (bot)
dd04697337
[3.11] gh-106461: typing: Consolidate docs on Callable (GH-106462) (#106575)
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:22:46 +01:00
Miss Islington (bot)
769b7d2d0b
[3.11] Move implementation specific RE tests to separate class (GH-106563) (GH-106565)
(cherry picked from commit 8cb6f9761e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-07-09 15:23:27 +03:00
Miss Islington (bot)
2d037fb406
[3.11] gh-106510: Fix DEBUG output for atomic group (GH-106511) (GH-106549)
(cherry picked from commit 74ec02e949)
2023-07-08 15:15:22 +03:00
Miss Islington (bot)
44c335e47d
[3.11] gh-101880: add link to object.__hash__() in hash() builtin documentation (GH-101883) (#106547)
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:23:00 +05:30
Serhiy Storchaka
6cd08a566f
[3.11] gh-106300: Improve assertRaises(Exception) usages in tests (GH-106302). (GH-106545)
(cherry picked from commit 6e6a4cd523)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-07-08 08:22:33 +00:00
Miss Islington (bot)
1931c2a438
[3.11] gh-90876: Restore the ability to import multiprocessing when sys.executable is None (GH-106464) (#106495)
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:20 -07:00
Miss Islington (bot)
80117dd450
[3.11] Doc: Add missing ref labels to exception groups/notes sections (GH-106465) (#106474)
Co-authored-by: C.A.M. Gerlach <CAM.Gerlach@Gerlach.CAM>
2023-07-06 00:05:04 -06:00
Miss Islington (bot)
ada22db147
[3.11] Clarify state of CancelledError in doc (GH-106453) (#106456)
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-05 11:16:56 -07:00