Commit graph

119414 commits

Author SHA1 Message Date
Miss Islington (bot)
b1bccab588
[3.12] gh-120811: Fix reference leak upon _PyContext_Exit failure (GH-120812) (#120844)
gh-120811: Fix reference leak upon `_PyContext_Exit` failure (GH-120812)
(cherry picked from commit aed31beca9)

Co-authored-by: Peter <zintensitydev@gmail.com>
Co-authored-by: Kumar Aditya <kumaraditya@python.org>
2024-06-22 16:44:31 +05:30
Miss Islington (bot)
f1acb3a592
[3.12] gh-104855: Update Tkinter tests for Tcl/Tk 8.7 and 9.0 (GH-120824) (GH-120865)
The tests are now passed with the current version of Tcl/Tk under
development (8.7b1+ and 9.0b3+).

The following changes were also made to make the tests more flexible:

* Helper methods like checkParam() now interpret the expected error message
  as a regular expression instead of a literal.
* Add support of new arguments in checkEnumParam():
  - allow_empty=True skips testing with empty string;
  - fullname= specifies the name for error message if it differs from the
    option name;
  - sort=True sorts values for error message.
* Add support of the allow_empty argument in checkReliefParam():
  allow_empty=True adds an empty string to the list of accepted values.
* Attributes _clip_highlightthickness, _clip_pad and  _clip_borderwidth
  specify how negative values of options -highlightthickness, -padx, -pady
  and -borderwidth are handled.
* Use global variables for some common error messages.

(cherry picked from commit 6ad26de6e8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-22 07:10:04 +00:00
Miss Islington (bot)
a57d917a48
[3.12] gh-120838: Add a Note in the Docs About Expectations for Py_Finalize() (gh-120853)
(cherry picked from commit 03fa2df927, AKA gh-120839)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2024-06-21 19:12:08 +00:00
Miss Islington (bot)
9bbb91c066
[3.12] gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778) (#120828)
gh-120773: document introspective attributes of an async generator object in the inspect module (GH-120778)
(cherry picked from commit 83d3d7aace)

Co-authored-by: blhsing <blhsing@gmail.com>
2024-06-21 16:58:58 +05:30
Miss Islington (bot)
d75eddcf36
[3.12] gh-120384: Fix array-out-of-bounds crash in list_ass_subscript (GH-120442) (#120825)
gh-120384: Fix array-out-of-bounds crash in `list_ass_subscript` (GH-120442)
(cherry picked from commit 8334a1b55c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-21 11:08:22 +00:00
Miss Islington (bot)
e58bece8ce
[3.12] gh-111259: Document idiomatic RE pattern (?s:.) that matches any character (GH-120745) (GH-120814)
(cherry picked from commit a2f6f7dd26)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-20 21:10:35 +00:00
Jelle Zijlstra
0c6d6ab252
[3.12] gh-119698: fix symtable.Class.get_methods and document its behaviour correctly (#120151) (#120776)
(cherry picked from commit b8a8e04fec)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 22:12:31 -07:00
Terry Jan Reedy
61e37dd4f5
[3.12] Fix typos in comments (GH-120481) (#120775)
Only 1 applicable change backported to 3.12.

(cherry picked from commit 656a1c8)

Co-authored-by: Xie Yanbo xieyanbo@gmail.com
2024-06-20 03:59:31 +00:00
Miss Islington (bot)
6421db1d4d
[3.12] gh-118820: Zero-valued flag enum has no name (GH-118848) (GH120758)
gh-118820: Zero-valued flag enum has no name (GH-118848)
(cherry picked from commit ed5ae6c4d7)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 15:11:58 -07:00
Miss Islington (bot)
34ace5ba4c
[3.12] gh-120732: Fix name passing to Mock, when using kwargs to create_autospec (GH-120737) (#120761)
gh-120732: Fix `name` passing to `Mock`, when using kwargs to `create_autospec` (GH-120737)
(cherry picked from commit 1e4815692f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-19 20:53:19 +00:00
Miss Islington (bot)
d6a36c97c2
[3.12] Regen `Doc/requirements-oldest-sphinx.txt` (GH-120753) (#120756)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-19 14:01:25 -06:00
Miss Islington (bot)
ae9b54bd48
[3.12] gh-120521: clarify except* documentation to allow tuples (GH-120523) (#120751)
(cherry picked from commit 58b3f11176)

Co-authored-by: Danny Yang <yangdanny97@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-19 12:06:52 -07:00
Jelle Zijlstra
d62cbba235
[3.12] gh-120722: Set position on RETURN_VALUE in lambda (GH-120724) (#120739)
(cherry picked from commit d8f27cb114)
2024-06-19 13:19:39 +00:00
Miss Islington (bot)
cde976d85c
[3.12] gh-119506: fix _io.TextIOWrapper.write() write during flush (GH-119507) (#119965)
gh-119506: fix `_io.TextIOWrapper.write()` write during flush (GH-119507)
(cherry picked from commit 52586f930f)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2024-06-19 10:23:29 +00:00
Miss Islington (bot)
57f955f9af
[3.12] gh-120449: fix `test_pyclbr` introspection for mangled names (GH-120450) (GH-120701)
gh-120449: fix ``test_pyclbr`` introspection for mangled names (GH-120450)
(cherry picked from commit d8cd0fa4e3)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2024-06-19 09:20:16 +02:00
Miss Islington (bot)
70d71fb4ea
[3.12] gh-120662: Improve smtplib example (GH-120668) (#120682)
gh-120662: Improve `smtplib` example (GH-120668)
(cherry picked from commit 4bc27abdbe)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-18 12:04:06 +00:00
Irit Katriel
5d997b5d4e
[3.12] gh-119897: Revert buggy optimization which was removed in 3.13 (#120467) 2024-06-18 10:45:40 +01:00
Miss Islington (bot)
4b53ea822c
[3.12] gh-120590: Fix test_pydoc in the refleak hunting mode (GH-120615) (GH-120670)
Mocking only works if sys.modules['pydoc'] and pydoc are the same,
but some pydoc functions reload the module and change sys.modules.
Ensure that sys.modules['pydoc'] is always restored after the corresponding
tests.
(cherry picked from commit 2cf47389e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-18 09:44:02 +00:00
Tian Gao
e4f1fed5f6
[3.12] gh-119824: Print stack entry when user input is needed … (#120594)
Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-17 10:40:49 -07:00
Miss Islington (bot)
e004914045
[3.12] gh-120586: Fix several "unused function" warnings in posixmodule.c (GH-120588) (#120617)
gh-120586: Fix several "unused function" warnings in `posixmodule.c` (GH-120588)
(cherry picked from commit 3df2022931)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-17 07:01:15 +00:00
Miss Islington (bot)
40ce124886
[3.12] gh-112346: Document the OS byte in gzip.compress output change in 3.11 (GH-120480) (#120613)
gh-112346: Document the OS byte in `gzip.compress` output change in 3.11 (GH-120480)
(cherry picked from commit bac4edad69)


gh-112346: Describe the "os" byte in gzip output change.

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-06-17 05:54:33 +00:00
Miss Islington (bot)
717d2bd1d9
[3.12] gh-120567: Clarify weekday return in calendar.monthrange docstring (GH-120570) (#120598)
gh-120567: Clarify weekday return in calendar.monthrange docstring (GH-120570)
(cherry picked from commit bd4516d9ef)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-16 21:03:09 +00:00
Miss Islington (bot)
7abfc92c8b
[3.12] gh-118596: Add thread-safety clarifications to the SSLContext documentation (GH-118597) (#120596)
gh-118596: Add thread-safety clarifications to the SSLContext documentation (GH-118597)

Add thread-safety clarifications to the SSLContext documentation. Per the issue:

This issue has also come up [here](https://github.com/psf/requests/pull/6667) where the matter was clarified by @tiran in [this comment](https://github.com/psf/requests/pull/6667):
> `SSLContext` is designed to be shared and used for multiple connections. It is thread safe as long as you don't reconfigure it once it is used by a connection. Adding new certs to the internal trust store is fine, but changing ciphers, verification settings, or mTLS certs can lead to surprising behavior. The problem is unrelated to threads and can even occur in a single-threaded program.
(cherry picked from commit 4f59f86382)

Co-authored-by: mm-matthias <43849132+mm-matthias@users.noreply.github.com>
2024-06-16 20:34:18 +00:00
Hugo van Kemenade
c2f0fb9644
[3.12] Docs: remove temporary hardcoded links and move inline JS to own file (GH-120348) (#120589)
[3.12] Docs: remove temporary hardcoded links (GH-120348)
(cherry picked from commit b8484c6ad7)
2024-06-16 09:14:22 -06:00
Nyuan Zhang
f774d49b7a
[3.12] gh-120572: add missing parentheses in TypeIs documentation (GH-120573) (#120578) 2024-06-15 23:50:27 -07:00
Miss Islington (bot)
a0e7e41d58
[3.12] gh-120360: Add self as IDLE doc owner (GH-120571) (#120577)
gh-120360: Add self as IDLE doc owner (GH-120571)

Add self as IDLE doc owner
(cherry picked from commit cf49ef78f8)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-06-16 06:12:48 +00:00
Terry Jan Reedy
51af315a32
[3.12] gh-120417: Remove unused import in idlelib (GH-120420) (#120574)
(cherry picked from commit 4c6d4f5)

Co-authored-by: Victor Stinner vstinner@python.org
2024-06-16 05:45:32 +00:00
Miss Islington (bot)
5185951335
[3.12] annotations: expand documentation on "simple" assignment targets (GH-120535) (#120556)
This behavior is rather surprising and it was not clearly specified.

(cherry picked from commit 9e0b11eb21)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 15:24:21 +00:00
Miss Islington (bot)
f03f4b15ef
[3.12] Add some more edge-case tests for inspect.get_annotations with eval_str=True (GH-120550) (#120552)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-15 13:10:01 +00:00
Miss Islington (bot)
4fb2af3195
[3.12] gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131) (#120136)
gh-120128: fix description of argument to ipaddress.collapse_addresses() (GH-120131)

The argument to collapse_addresses() is now described as an *iterable*
(rather than *iterator*).
(cherry picked from commit f878d46e56)

Co-authored-by: Jan Kaliszewski <zuo@kaliszewski.net>
2024-06-15 06:12:45 -06:00
Miss Islington (bot)
454f7e8035
[3.12] gh-120544: Add else: fail() to tests where exception is expected (GH-120545) (#120547)
gh-120544: Add `else: fail()` to tests where exception is expected (GH-120545)
(cherry picked from commit 42ebdd83bb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-15 12:54:22 +01:00
Miss Islington (bot)
1242c2739a
[3.12] gh-120495: Fix incorrect exception handling in Tab Nanny (GH-120498) (#120549)
gh-120495: Fix incorrect exception handling in Tab Nanny (GH-120498)
(cherry picked from commit c501261c91)

Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-15 11:21:05 +00:00
Miss Islington (bot)
92c1687074
[3.12] gh-119819: Conditional skip of logging tests that require multiprocessing subprocess support (GH-120476) (#120532)
gh-119819: Conditional skip of logging tests that require multiprocessing subprocess support (GH-120476)

Skip tests that require multiprocessing subprocess support.
(cherry picked from commit 92f6d400f7)

Co-authored-by: Russell Keith-Magee <russell@keith-magee.com>
2024-06-15 08:32:28 +08:00
Miss Islington (bot)
d2105a1eab
[3.12] gh-120361: Add nonmember test with enum flags inside to test_enum (GH-120364) (#120512)
gh-120361: Add `nonmember` test with enum flags inside to `test_enum` (GH-120364)

* gh-120361: Add `nonmember` test with enum flags inside to `test_enum`
(cherry picked from commit 7fadfd82eb)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-06-14 20:59:12 +03:00
Miss Islington (bot)
183445338d
[3.12] gh-114053: Fix bad interaction of PEP 695, PEP 563 and inspect.get_annotations (GH-120270) (#120475)
gh-114053: Fix bad interaction of PEP 695, PEP 563 and `inspect.get_annotations` (GH-120270)
(cherry picked from commit 42351c3b9a)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-13 21:35:21 +00:00
Miss Islington (bot)
c9fc099c59
[3.12] GH-119054: Add "Renaming and deleting" section to pathlib docs. (GH-120465) (#120473)
GH-119054: Add "Renaming and deleting" section to pathlib docs. (GH-120465)

Add dedicated subsection for `pathlib.Path.rename()`, `replace()`,
`unlink()` and `rmdir()`.
(cherry picked from commit d88a1f2e15)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-06-13 20:31:52 +00:00
neonene
7719eefcce
[3.12] gh-71587: Drop local reference cache to _strptime module in _datetime (gh-120431)
The _strptime module object was cached in a static local variable (in the datetime.strptime() implementation).  That's a problem when it crosses isolation boundaries, such as reinitializing the runtme or between interpreters.  This change fixes the problem by dropping the static variable, instead always relying on the normal sys.modules cache (via PyImport_Import()).

(cherry picked from commit 127c1d2771, AKA gh-120224)
2024-06-13 12:47:46 -06:00
Barney Gale
eff055340f
[3.12] GH-119054: Add "Creating files and directories" section to pathlib docs. (GH-120186) (#120464)
Add dedicated subsection for `pathlib.Path.touch()`, `mkdir()`,
`symlink_to()` and `hardlink_to()`. Also note that `open()`, `write_text()`
and `write_bytes()` are often used to create files.

(cherry picked from commit c2d810b6d4)
2024-06-13 19:21:27 +01:00
Miss Islington (bot)
f8dd4c3b06
[3.12] gh-119146: Update `regexp in build.yml to not trigger the jobs on *.md and *.ini` files. (GH-120435) (#120448)
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-13 12:39:05 +00:00
Irit Katriel
5a6cc3c67f
[3.12] gh-93691: fix too broad source locations of for statement iterators (GH-120330 (#120405)
[3.12] gh-93691: fix too broad source locations of for statement iterators (GH-120330).
(cherry picked from commit 97b69db167)
2024-06-13 11:38:36 +01:00
Miss Islington (bot)
89523230d8
[3.12] gh-101575: document Decimal.__round__() (GH-101737) (GH-120395)
gh-101575: document Decimal.__round__() (GH-101737)
(cherry picked from commit 7dd8c37a06)

Co-authored-by: Owain Davies <116417456+OTheDev@users.noreply.github.com>
2024-06-13 09:10:17 +02:00
Xie Yanbo
0976c9f4bd
[3.12] Fix typos in documentation (GH-120338) (#120439)
(cherry picked from commit ce3879bd45)
2024-06-13 09:32:35 +03:00
Miss Islington (bot)
f75abf8bcf
[3.12] gh-120343: Fix column offsets of multiline tokens in tokenize (GH-120391) (#120428)
(cherry picked from commit 4b5d3e0e72)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
2024-06-12 19:10:35 +00:00
Miss Islington (bot)
319233f137
[3.12] gh-120345: Fix incorrect use of the :class: role with the "()" suffix (GH-120347) (GH-120412)
* Remove "()" when refer to a class as a type.
* Use :func: when refer to a callable.
* Fix reference to the datetime.astimezone() method.
(cherry picked from commit 92c9c6ae14)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-12 14:42:06 +00:00
Miss Islington (bot)
ab30934365
[3.12] gh-120155: Add assertion to sre.c match_getindex() (GH-120402) (#120410)
gh-120155: Add assertion to sre.c match_getindex() (GH-120402)

Add an assertion to help static analyzers to detect that i*2 cannot
overflow.
(cherry picked from commit 42b25dd61f)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-06-12 13:57:45 +00:00
Ken Jin
e8a9f0c9e7
gh-120198: Fix race condition when editing __class__ with an audit hook active (GH-120195)
Co-authored-by: Nadeshiko Manju <me@manjusaka.me>
2024-06-12 14:06:24 +01:00
Miss Islington (bot)
0315fdc24d
[3.12] gh-120343: Do not reset byte_col_offset_diff after multiline tokens (GH-120352) (#120356)
(cherry picked from commit 1b62bcee94)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
2024-06-11 17:22:16 +00:00
Miss Islington (bot)
92e1c136b5
[3.12] Fix typo in ElementTree docs (GH-120342) (#120358)
Fix typo in ElementTree docs (GH-120342)
(cherry picked from commit 0335662fe1)

Co-authored-by: naglis <827324+naglis@users.noreply.github.com>
2024-06-11 17:19:06 +00:00
Miss Islington (bot)
e123f74513
[3.12] gh-120268: Prohibit passing `None to _pydatetime.date.fromtimestamp` (GH-120269) (GH-120283)
This makes the pure Python implementation consistent with the C implementation.
(cherry picked from commit 34f5ae69fe)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-11 12:54:20 +03:00
Miss Islington (bot)
b8845369aa
[3.12] gh-120298: Fix use-after-free in list_richcompare_impl (GH-120303) (#120339)
gh-120298: Fix use-after-free in `list_richcompare_impl` (GH-120303)
(cherry picked from commit 141babad9b)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-11 07:22:59 +00:00