Commit graph

119339 commits

Author SHA1 Message Date
Łukasz Langa 94eee78759
[3.12] gh-120111: Don't use cirrus M1 macOS runners on fork (GH-120116) (GH-120153)
(cherry picked from commit fd104dfcb8)

Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2024-06-06 14:30:20 +02:00
Alex Waygood c5d1fbd4ce
[3.12] typing docs: fix indentation of TypedDict deprecation notice (#120124) 2024-06-05 10:37:24 -07:00
Miss Islington (bot) 376c734216
[3.12] gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657) (#120106)
gh-119287: clarify doc on BaseExceptionGroup.derive and link to it from contextlib.suppress (GH-119657)
(cherry picked from commit 5c02ea8bae)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-06-05 12:02:52 +00:00
Miss Islington (bot) 8d199774cb
[3.12] gh-119819: Update logging configuration to support joinable multiproc… (GH-120090) (GH-120092)
(cherry picked from commit 983efcf15b)
2024-06-05 07:59:15 +01:00
Miss Islington (bot) c46621bf33
[3.12] gh-120078: Fix struct_time attr typo tm_day -> tm_mday in Doc/library/time.rst (GH-120084)
(cherry picked from commit b6b0dcbfc0)

Co-authored-by: shurj0 <60540027+shurj0@users.noreply.github.com>
2024-06-05 00:29:28 +00:00
Jelle Zijlstra dc40226ea1
[3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464) (#119644)
* [3.12] gh-119311: Fix name mangling with PEP 695 generic classes (#119464)

Fixes #119311. Fixes #119395.

(cherry picked from commit a9a74da4a0)
2024-06-04 19:55:45 +00:00
Miss Islington (bot) 008f9dd027
[3.12] gh-119819: Update test to skip if _multiprocessing is unavailable. (GH-120067) (GH-120071)
(cherry picked from commit 109e1082ea)
2024-06-04 20:43:52 +01:00
Miss Islington (bot) 210cd98f75
[3.12] gh-120048: Make test_imaplib faster (GH-120050) (#120070)
The `test_imaplib` was taking 40+ minutes in the refleak build bots because
the tests waiting on a client `self._setup()` was creating a client that
prevented progress until its connection timed out, which scaled with the
global timeout.

We should set `connect=False` for the tests that don't want `_setup()` to
create a client.

(cherry picked from commit 710cbea660)

Co-authored-by: Sam Gross <colesbury@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-06-04 19:25:17 +00:00
Miss Islington (bot) c8c23aa86e
[3.12] gh-120039: Reduce expected timeout in test_siginterrupt_off (GH-120047) (#120061)
The process is expected to time out. In the refleak builds,
`support.SHORT_TIMEOUT` is often five minutes and we run the tests six
times, so test_signal was taking >30 minutes.
(cherry picked from commit d419d468ff)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-06-04 18:10:41 +00:00
Serhiy Storchaka f98ec7574a
[3.12] gh-89928: Fix integer conversion of device numbers (GH-31794) (GH-120054)
Fix os.major(), os.minor() and os.makedev().
Support device numbers larger than 2**63-1.
Support non-existent device number (NODEV).
(cherry picked from commit 7111d9605f)
2024-06-04 17:12:13 +00:00
Miss Islington (bot) 0e150c36de
[3.12] gh-119819: Fix regression to allow logging configuration with multipr… (GH-120030) (GH-120034)
(cherry picked from commit 99d945c0c0)
2024-06-04 13:41:02 +01:00
Miss Islington (bot) fe68908c54
[3.12] gh-118868: logging QueueHandler fix passing of kwargs (GH-118869) (GH-120031)
(cherry picked from commit dce14bb2dc)
2024-06-04 13:17:46 +01:00
Miss Islington (bot) b5c3394fce
[3.12] gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846) (GH-120016)
gh-119070: Update test_shebang_executable_extension to always use non-installed version (GH-119846)
(cherry picked from commit 5c48eb0cc6)
2024-06-04 13:27:58 +02:00
Victor Stinner e3e7607167
[3.12] gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021) (#120023)
gh-111499: Fix PYTHONMALLOCSTATS at Python exit (#120021)

Call _PyObject_DebugMallocStats() earlier in Py_FinalizeEx(), before
the interpreter is deleted.

(cherry picked from commit 5a1205b641)
2024-06-04 09:58:49 +00:00
Jelle Zijlstra 3bf7a5079c
[3.12] gh-119821: Fix refleak in LOAD_FROM_DICT_OR_GLOBALS (#119975) 2024-06-03 12:26:25 -07:00
Łukasz Langa 0480fd628a
[3.12] Use Cirrus M1 macOS runners for CI (GH-119979) (GH-119987)
(cherry picked from commit 6acb32fac3)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
Co-authored-by: Ee Durbin <ee@python.org>
2024-06-03 18:15:54 +02:00
Barney Gale 059be67b51
[3.12] GH-119054: Add "Reading and writing files" section to pathlib docs (GH-119524) (#119955)
Add a dedicated subsection for `open()`, `read_text()`, `read_bytes()`,
`write_text()` and `write_bytes()`.

(cherry picked from commit bd6d4ed645)
2024-06-02 21:14:29 +01:00
Barney Gale 85020647c2
[3.12] GH-119054: Add "Querying file type and status" section to pathlib docs (GH-119055) (#119952)
Add a dedicated subsection for `Path.stat()`-related methods, specifically
`stat()`, `lstat()`, `exists()`, `is_*()`, and `samefile()`.

(cherry picked from commit 81d6336230)
2024-06-02 20:38:00 +01:00
Miss Islington (bot) c8de0ec7b9
[3.12] Improve documentation for typing.get_type_hints (GH-119928) (#119944)
- Explicit list of what it does that is different from
  "just return __annotations__"
- Remove reference to PEP 563; adding the future import doesn't
  do anything to type aliases, and in general it will never make
  get_type_hints() less likely to fail.
- Remove example, as the Annotated docs already have a similar
  example, and it's unbalanced to have one example about this
  one edge case but not about other behaviors of the function.

(cherry picked from commit aa9fe98e06)

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-02 15:21:47 +00:00
Miss Islington (bot) e57a4a19a1
[3.12] gh-119016: Remove outdated sentences from the "classes" tutorial (GH-119130) (#119926)
Co-authored-by: Nice Zombies <nineteendo19d0@gmail.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2024-06-01 21:26:07 +00:00
Miss Islington (bot) 46545d3244
[3.12] gh-116145: Update macOS installer to Tcl/Tk 8.6.14 (GH-116151) (GH-119922)
(cherry picked from commit 4fa95c6ec3)
Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2024-06-01 20:23:05 +00:00
Barney Gale feb7870b46
[3.12] GH-89727: Fix shutil.rmtree() recursion error on deep trees (GH-119808) (#119919)
Implement `shutil._rmtree_safe_fd()` using a list as a stack to avoid emitting recursion errors on deeply nested trees.

`shutil._rmtree_unsafe()` was fixed in a150679f90.

(cherry picked from commit 53b1981fb0)
2024-06-01 20:39:35 +01:00
Miss Islington (bot) 60393f5f14
[3.12] Add unique() recipe to itertools docs (gh-119911) (gh-119917) 2024-06-01 12:06:18 -05:00
Miss Islington (bot) 55f65156cb
[3.12] gh-113892: Add a extra check to ProactorEventLoop.sock_connect to ensure that the given socket is in non-blocking mode (GH-119519) (#119913)
(cherry picked from commit cf3bba3f06)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-06-01 16:29:34 +00:00
Victor Stinner 34a0e7a824
[3.12] Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#1… (#119905)
Revert "[3.12] gh-69214: Fix fcntl.ioctl() request type (#119498) (#119505)"

This reverts commit 078da88ad1.

The change modified how negative values, like termios.TIOCSWINSZ, was
treated and is actually backward incompatible.
2024-06-01 17:08:07 +02:00
Jelle Zijlstra 6d9677d78e
[3.12] gh-119821: Support non-dict globals in LOAD_FROM_DICT_OR_GLOBALS (#119822) (#119890)
The implementation basically copies LOAD_GLOBAL. Possibly it could be deduplicated,
but that seems like it may get hairy since the two operations have different operands.

This is important to fix in 3.14 for PEP 649, but it's a bug in earlier versions too,
and we should backport to 3.13 and 3.12 if possible.

(cherry picked from commit 80a4e38994)
2024-05-31 21:56:38 -07:00
Miss Islington (bot) 2f7fada580
[3.12] contextlib docs: Clean up redundant 'up' after 'cleanup' (GH-119873)
Reported by Michael Kass on docs@
(cherry picked from commit f3fc800d5f)
2024-05-31 17:27:57 +00:00
Miss Islington (bot) 045be7729e
[3.12] gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364) (#119870)
gh-100117: Fix inaccuracy in documentation of the CodeObject's co_positions field. (GH-119364)
(cherry picked from commit 015b1fdd0a)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2024-05-31 18:24:11 +01:00
Sam Gross 738cf21609
[3.12] gh-119585: Fix crash involving PyGILState_Release() and PyThreadState_Clear() (GH-119753) (#119861)
Make sure that `gilstate_counter` is not zero in when calling
`PyThreadState_Clear()`. A destructor called from `PyThreadState_Clear()` may
call back into `PyGILState_Ensure()` and `PyGILState_Release()`. If
`gilstate_counter` is zero, it will try to create a new thread state before
the current active thread state is destroyed, leading to an assertion failure
or crash.
(cherry picked from commit bcc1be39cb)
2024-05-31 15:42:09 +00:00
Serhiy Storchaka d4680b9e17
[3.12] gh-103194: Fix Tkinter’s Tcl value type handling for Tcl 8.7/9.0 (GH-103846) (GH-119831)
Some of standard Tcl types were renamed, removed, or no longer
registered in Tcl 8.7/9.0. This change fixes automatic conversion of Tcl
values to Python values to avoid returning a Tcl_Obj where the primary
Python types (int, bool, str, bytes) were returned in older Tcl.
(cherry picked from commit 94e9585e99)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2024-05-31 09:15:53 +00:00
Miss Islington (bot) bd0d97ce34
[3.12] gh-107262: Update Tkinter tests for Tcl/Tk 8.6.14 (GH-119322) (GH-119807)
(cherry picked from commit 9732ed5ca9)

Co-authored-by: James De Bias <81095953+DBJim@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-30 21:23:38 +00:00
Serhiy Storchaka 207d1b032f
[3.12] gh-109218: Improve documentation for the complex() constructor (GH-119687) (ПР-119805)
* Remove the equivalence with real+imag*1j which can be incorrect in corner
  cases (non-finite numbers, the sign of zeroes).
* Separately document the three roles of the constructor: parsing a string,
  converting a number, and constructing a complex from components.
* Document positional-only parameters of complex(), float(), int() and bool()
  as positional-only.
* Add examples for complex() and int().
* Specify the grammar of the string for complex().
* Improve the grammar of the string for float().
* Describe more explicitly the behavior when real and/or imag arguments are
  complex numbers. (This will be deprecated in future.)
(cherry picked from commit ec1ba26460)
2024-05-30 20:52:44 +00:00
Miss Islington (bot) 2e31e5695d
[3.12] gh-109218: Refactor tests for the complex() constructor (GH-119635) (GH-119796)
* Share common classes.
* Use exactly representable floats and exact tests.
* Check the sign of zero components.
* Remove duplicated tests (mostly left after merging int and long).
* Reorder tests in more consistent way.
* Test more error messages.
* Add tests for missed cases.
(cherry picked from commit bf098d4157)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-05-30 18:05:38 +00:00
Miss Islington (bot) 863da7291c
[3.12] gh-119779: Fix pyporting howto docs (GH-119785) (#119789)
gh-119779: Fix pyporting howto docs (GH-119785)
(cherry picked from commit 6fb191be15)

Co-authored-by: Awbert <119314310+SweetyAngel@users.noreply.github.com>
2024-05-30 15:57:36 +00:00
Steve Dower e85e813bf1
gh-119690: Adds Unicode support for named pipes in _winapi (GH-119717)
Also backports a minor improvement to test_audit.
2024-05-30 15:40:23 +01:00
Miss Islington (bot) fae9c92ba7
[3.12] gh-118055: Update the finder glossary entry (GH-118278) (GH-119774)
gh-118055: Update the finder glossary entry (GH-118278)
(cherry picked from commit db009348b4)

Co-authored-by: Lincoln <71312724+Lincoln-developer@users.noreply.github.com>
2024-05-30 08:57:36 +00:00
Miss Islington (bot) e408059711
[3.12] subprocess docs: Fix semantically important typo (GH-119752) (#119758)
subprocess docs: Fix semantically important typo (GH-119752)

GH-25416 accidentally replaced a reference to the *stderr* argument of
`subprocess.run` with a reference to the *stdin* argument.  *stdin* is
not affected by the `check_output` option.
(cherry picked from commit 2cc3502f98)

Co-authored-by: Zachary Ware <zach@python.org>
2024-05-30 08:50:23 +01:00
Miss Islington (bot) d4a146d567
[3.12] GH-89727: Fix FD leak on os.fwalk() generator finalization. (GH-119766) (#119768)
GH-89727: Fix FD leak on `os.fwalk()` generator finalization. (GH-119766)

Follow-up to 3c890b50. Ensure we `os.close()` open file descriptors when
the `os.fwalk()` generator is finalized.
(cherry picked from commit a5fef800d3)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-05-30 05:30:37 +01:00
Miss Islington (bot) aae371bda4
[3.12] GH-89727: Fix os.fwalk() recursion error on deep trees (GH-119638) (#119765)
GH-89727: Fix `os.fwalk()` recursion error on deep trees (GH-119638)

Implement `os.fwalk()` using a list as a stack to avoid emitting recursion
errors on deeply nested trees.
(cherry picked from commit 3c890b503c)

Co-authored-by: Barney Gale <barney.gale@gmail.com>
2024-05-30 03:32:14 +00:00
Miss Islington (bot) 681d7da144
[3.12] gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480) (#119761)
gh-119260: Clarify is_dataclass Behavior for Subclasses in Documentation and Tests (GH-119480)
(cherry picked from commit bf4ff3ad2e)

Co-authored-by: Aditya Borikar <adityaborikar2@gmail.com>
Co-authored-by: Carl Meyer <carl@oddbird.net>
2024-05-30 03:24:50 +00:00
Barney Gale 45587df8d0
[3.12] GH-89727: Partially fix shutil.rmtree() recursion error on deep trees (GH-119634) (#119749)
* GH-89727: Partially fix `shutil.rmtree()` recursion error on deep trees (#119634)

Make `shutil._rmtree_unsafe()` call `os.walk()`, which is implemented
without recursion.

`shutil._rmtree_safe_fd()` is not affected and can still raise a recursion
error.

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit a150679f90)
2024-05-29 21:53:08 +01:00
Steve Dower e902503980
gh-119070: Avoid test crash due to Unicode in stderr output (GH-119747) 2024-05-29 20:51:30 +00:00
Steve Dower bc01c5d225
gh-119070: Fix py.exe handling of /usr/bin/env commands missing extension (GH-119426) 2024-05-29 20:12:55 +01:00
Miss Islington (bot) a62681c405
[3.12] gh-119704: Fix reference leak in the `Python/Python-tokenize.c` (GH-119705) (#119708) 2024-05-29 07:18:04 +00:00
Miss Islington (bot) 46a37a1a92
[3.12] gh-119538: Add missing expat build dependencies (GH-119647) (#119686)
xmltok_impl.c and xmltok_ns.c are _included_ in xmltok.c by the C
pre-processor.

(cherry picked from commit 606be66362)

Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-05-28 22:10:49 +00:00
Miss Islington (bot) 4a0af0cfdc
[3.12] gh-119118: Fix performance regression in tokenize module (GH-119615) (#119683)
- Cache line object to avoid creating a Unicode object
  for all of the tokens in the same line.
- Speed up byte offset to column offset conversion by using the
  smallest buffer possible to measure the difference.

(cherry picked from commit d87b015106)

Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
2024-05-28 22:49:02 +02:00
Jelle Zijlstra 7f06cd335e
[3.12] gh-119011: type.__type_params__ now return an empty tuple (GH-119296) (#119681)
(cherry picked from commit 6b240c2308)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-05-28 19:54:47 +00:00
Miss Islington (bot) 08636c1a7d
[3.12] gh-119581: Add a test of InitVar with name shadowing (GH-119582) (#119673)
gh-119581: Add a test of InitVar with name shadowing (GH-119582)
(cherry picked from commit 6ec371223d)

Co-authored-by: Steven Troxler <steven.troxler@gmail.com>
2024-05-28 17:42:01 +00:00
Miss Islington (bot) 3af9b75df5
[3.12] Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409) (GH-119482)
Clarify base64.a85encode docs: *wrapcols* doesn't count the newline (GH-119409)
(cherry picked from commit ffa24aab10)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-05-28 16:55:43 +02:00
Miss Islington (bot) 5cca0419cf
[3.12] [doc] Clarify the nature of the root logger in the logging documentation (GH-119440) (GH-119652)
(cherry picked from commit b407ad38fb)
2024-05-28 15:04:19 +01:00