Commit graph

118809 commits

Author SHA1 Message Date
Miss Islington (bot)
663945e5a6
[3.12] gh-94606: Fix error when message with Unicode surrogate not surrogateescaped string (GH-94641) (GH-112971)
(cherry picked from commit 27a5fd8cb8)

Co-authored-by: Sidney Markowitz <sidney@sidney.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-11 16:48:06 +00:00
Miss Islington (bot)
ceabbeaca3
[3.12] gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939) (#112960)
gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939)

* gh-112898: warn about unsaved files when quitting IDLE on macOS

Implement the TK function ``::tk::mac::Quit`` on macOS to
ensure that IDLE asks about saving unsaved files when
quitting IDLE.

(cherry picked from commit 3251ba8f1a)


Co-authored-by: Christopher Chavez chrischavez@gmx.us

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-11 17:14:15 +01:00
Pablo Galindo Salgado
e4d2fb242a
[3.12] gh-112943: Correctly compute end offsets for multiline tokens in the tokenize module (GH-112949) (#112957)
(cherry picked from commit a135a6d2c6)
2023-12-11 12:48:19 +00:00
Miss Islington (bot)
f3933d4b98
[3.12] Fix SyntaxWarning in test_syntax.py (GH-112944) (GH-112955)
(cherry picked from commit 97cd45bfdb)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2023-12-11 12:13:01 +00:00
Miss Islington (bot)
78a5010a4e
[3.12] GH-101986: Support translation for Limited/Unstable API & Stable ABI (GH-107680) (#112940)
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
Co-authored-by: Ezio Melotti <ezio.melotti@gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-10 19:23:14 +00:00
Miss Islington (bot)
68657e2b73
[3.12] gh-109980: Fix test_tarfile_vs_tar on macOS (GH-112905) (#112927)
gh-109980: Fix test_tarfile_vs_tar on macOS (GH-112905)

On recentish macOS versions the system tar
command includes system metadata (ACLs, extended attributes
and resource forks) in the tar archive, which
shutil.make_archive will not do. This can cause
spurious test failures.
(cherry picked from commit dd2ebdf89f)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-10 19:49:39 +01:00
Miss Islington (bot)
c108080626
Doc: c-api: fix order of PyMemberDef fields (GH-112879)
Doc: c-api: fix order of PyMemberDef fields (GH-112879)
(cherry picked from commit 42a86df3a3)
2023-12-10 17:50:05 +00:00
Miss Islington (bot)
02fbe89342
[3.12] gh-101100: Fix Sphinx warning in library/http.cookies.rst (GH-112908) (#112929)
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Fix Sphinx warning in library/http.cookies.rst (GH-112908)
2023-12-10 12:59:25 +00:00
Miss Islington (bot)
81c2df0f8b
[3.12] Docs: Use 'f-strings' as header (GH-112888) (#112923)
Docs: Use 'f-strings' as header (GH-112888)
(cherry picked from commit 5bf7580d72)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-10 11:36:01 +02:00
Miss Islington (bot)
fd5d3aec2a
[3.12] IDLE: Tweak iomenu.IOBinding.maybesave (GH-112914) (#112917)
Add docstring, use f-string, simplify code.
(cherry picked from commit ca1bde8943)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-10 02:56:28 +00:00
Miss Islington (bot)
b23034de9d
[3.12] gh-101100: Improve documentation of TracebackType attributes (GH-112884) (#112911)
gh-101100: Improve documentation of `TracebackType` attributes (GH-112884)
(cherry picked from commit 96f64a2b1b)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-09 22:50:33 +00:00
Alex Waygood
ebcf7577a7
[3.12] gh-101100: Fix Sphinx nitpicks in library/tempfile.rst (#112886) (#112910)
(cherry-picked from commit 54410e6bd9)

Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-09 22:47:01 +00:00
Ronald Oussoren
65371511b9
[3.12] gh-110820: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834)
* gh-110820: Make sure processor specific defines are correct for Universal 2 build on macOS (#112828)

A number of processor specific defines are different for x86-64 and
arm64, and need to be adjusted in pymacconfig.h.

(cherry picked from commit 15a80b15af)
2023-12-09 15:53:16 +01:00
Serhiy Storchaka
7e82c626c4
[3.12] gh-79429: Ignore FileNotFoundError when remove a temporary directory in the multiprocessing finalizer (GH-112865) 2023-12-09 15:13:40 +02:00
Miss Islington (bot)
259a4af3d2
[3.12] gh-112758: Updated pathlib documentation for PurePath.match (GH-112814) (#112882)
gh-112758: Updated pathlib documentation for PurePath.match (GH-112814)
(cherry picked from commit ed8720ace4)

Co-authored-by: Taylor Packard <3.t.packard@gmail.com>
2023-12-08 18:26:46 +00:00
Alex Waygood
0260c38e80
[3.12] gh-101100: Fix Sphinx nits in library/contextlib.rst (#112870) (#112875)
(cherry-picked from commit e4c0876033)
2023-12-08 14:03:38 +00:00
Miss Islington (bot)
b39e90e4d1
[3.12] gh-101100: Improve documentation for attributes on instance methods (GH-112832) (#112872)
gh-101100: Improve documentation for attributes on instance methods (GH-112832)
(cherry picked from commit ed21d0c1f4)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-08 13:25:52 +00:00
Miss Islington (bot)
7ef3a1e64b
[3.12] gh-101100: Fix Sphinx nitpicks in library/shelve.rst (GH-112836) (#112868)
gh-101100: Fix Sphinx nitpicks in `library/shelve.rst` (GH-112836)
(cherry picked from commit 3cdcc2edf8)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-08 12:37:45 +00:00
Miss Islington (bot)
46f86f50be
[3.12] gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834) (#112851)
gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834)

Test test_stress_modifying_handlers in test_signal can crash
the interpreter due to a bug in macOS. Filed as FB13453490
with Apple.
(cherry picked from commit bf0beae6a0)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-08 10:07:34 +01:00
Thomas Wouters
8b58d12f6c Merge branch '3.12' of https://github.com/python/cpython into 3.12 2023-12-08 01:40:16 +01:00
Thomas Wouters
71cbc6a78f Post 3.12.1 2023-12-08 01:39:55 +01:00
Alex Waygood
fb02db75cb
[3.12] gh-101100: Silence Sphinx warnings when ntpath or posixpath are referenced (#112833) (#112857)
(cherry-picked from commit 2c3906bc4b)
2023-12-07 21:10:12 +00:00
Thomas Wouters
2305ca5144 Python 3.12.1 2023-12-07 21:46:47 +01:00
Eric Snow
c0fc88fa2f
[3.12] gh-112826: Fix the threading Module When _thread is Missing _is_main_interpreter() (#112850)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Hugo van Kemenade <hugovk@users.noreply.github.com>
2023-12-07 20:15:20 +00:00
Miss Islington (bot)
34e9e20cf2
[3.12] gh-79325: Fix recursion error in TemporaryDirectory cleanup on Windows (GH-112762) (GH-112847)
(cherry picked from commit b2923a61a1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-07 17:36:29 +00:00
Miss Islington (bot)
418adf687f
[3.12] gh-87319: Simplify TemporaryDirectory cleanup using os.path.isjunction() (GH-112791) (GH-112845)
(cherry picked from commit ba18893555)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-07 17:17:27 +00:00
Miss Islington (bot)
6ceb8aeda5
[3.12] gh-91133: tempfile.TemporaryDirectory: fix symlink bug in cleanup (GH-99930) (GH-112838)
(cherry picked from commit 81c16cd94e)

Co-authored-by: Søren Løvborg <sorenl@unity3d.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-07 18:35:50 +02:00
Łukasz Langa
8f1c9128dd
[3.12] gh-110190: Temporarily skip new test introduced in gh-112604 on PPC64LE (GH-112818) (#112829)
(cherry picked from commit 9f67042f28)

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2023-12-07 14:07:45 +00:00
Victor Stinner
f27271619e
[3.12] gh-112125: Fix None.__ne__(None) returning NotImplemented instead of … (#112827)
gh-112125: Fix None.__ne__(None) returning NotImplemented instead of False (#112504)

(cherry picked from commit 9c3458e058)

Co-authored-by: andrewluotechnologies <44252973+andrewluotechnologies@users.noreply.github.com>
2023-12-07 13:41:00 +00:00
Miss Islington (bot)
e21a7a976a
[3.12] gh-109981: Fix support.fd_count() on macOS 14 (GH-112797) (#112824)
gh-109981: Fix support.fd_count() on macOS 14 (GH-112797)

Use scanning "/dev/fd/" on macOS in support.fd_count(). That's both more efficient than scanning all possible file descriptors, and avoids crashing the interpreter when there are open "guarded" file descriptors.

"Guarded" file descriptors are a macOS feature where file descriptors used by system libraries are marked and cause hard crashes when used by "user" code.

(cherry picked from commit 953ee622b3)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-07 11:28:26 +01:00
Alex Waygood
ca11aec98c
[3.12] gh-101100: Improve documentation of code object attributes (#112781) (#112816)
(cherry-picked from commit e9707d3c3d)
2023-12-06 22:11:53 +00:00
Miss Islington (bot)
af7cf385a2
[3.12] gh-101100: Fix Sphinx nitpicks in library/reprlib.rst (GH-112811) (#112813)
gh-101100: Fix Sphinx nitpicks in `library/reprlib.rst` (GH-112811)
(cherry picked from commit 3870d19d15)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-06 20:22:42 +00:00
Diego Russo
f941ecfffa
[3.12] gh-110190: Fix ctypes structs with array on Arm (#112604) (#112767)
Set MAX_STRUCT_SIZE to 32 in stgdict.c when on Arm platforms.
This because on Arm platforms structs with at most 4 elements of any
floating point type values can be passed through registers. If the type
is double the maximum size of the struct is 32 bytes.
On x86-64 Linux, it's maximum 16 bytes hence we need to differentiate.

(cherry picked from commit bc68f4a4ab)
2023-12-06 16:57:34 +01:00
Miss Islington (bot)
f189bd3e83
[3.12] gh-75666: Tkinter: "unbind(sequence, funcid)" now only unbinds "funcid" (GH-111322) (GH-112802)
Previously, "widget.unbind(sequence, funcid)" destroyed the current binding
for "sequence", leaving "sequence" unbound, and deleted the "funcid"
command.

Now it removes only "funcid" from the binding for "sequence", keeping
other commands, and deletes the "funcid" command.
It leaves "sequence" unbound only if "funcid" was the last bound command.

(cherry picked from commit cc7e45cc57)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: GiovanniL <13402461+GiovaLomba@users.noreply.github.com>
2023-12-06 15:12:37 +00:00
Miss Islington (bot)
399a3f2e1e
[3.12] gh-111178: Docs: fix traverseproc, inquiry, and destructor parameters in slot typedefs table (GH-112742) (GH-112792)
gh-111178: Docs: fix `traverseproc`, `inquiry`, and `destructor` parameters in slot typedefs table (GH-112742)

In the slot typedefs table, the parameter of `destructor`
and the first parameter of `traverseproc` should both be
`PyObject *` rather than `void *`.
Same for `inquiry`.
(cherry picked from commit 00cce0fe49)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2023-12-06 11:03:22 +01:00
Miss Islington (bot)
7527cdaaaf
[3.12] gh-101100: Fix most Sphinx nitpicks in the glossary and stdtypes.rst (GH-112757) (#112789)
gh-101100: Fix most Sphinx nitpicks in the glossary and `stdtypes.rst` (GH-112757)
(cherry picked from commit e3f670e137)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-06 08:50:30 +00:00
Serhiy Storchaka
cf16aaae80
[3.12] gh-108927: Include new dir test/regrtestdata in the installation (GH-112765) (GH-112785)
(cherry picked from commit f8c0198e3b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-06 08:14:34 +00:00
Miss Islington (bot)
5720f7fcdf
[3.12] gh-112769: test_zlib: Fix comparison of ZLIB_RUNTIME_VERSION with non-int suffix (GH-112771) (GH-112773)
zlib-ng defines the version as "1.3.0.zlib-ng".
(cherry picked from commit d384813ff1)

Co-authored-by: Miro Hrončok <miro@hroncok.cz>
2023-12-05 20:03:00 +00:00
Miss Islington (bot)
ef92e9e666
[3.12] gh-101100: Properly document frame object attributes (GH-112735) (#112772)
gh-101100: Properly document frame object attributes (GH-112735)
(cherry picked from commit d109f637c0)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-05 19:34:06 +00:00
Miss Islington (bot)
e63bb9caf0
[3.12] bpo-35332: Handle os.close() errors in shutil.rmtree() (GH-23766) (GH-112763)
* Ignore os.close() errors when ignore_errors is True.
* Pass os.close() errors to the error handler if specified.
* os.close no longer retried after error.

(cherry picked from commit 11d88a178b)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 17:38:44 +00:00
Miss Islington (bot)
5acfb8258a
[3.12] bpo-43153: Don't mask PermissionError with NotADirectoryError during tempdirectory cleanup (GH-29940) (GH-112753)
(cherry picked from commit 8cdfee1bb9)

Co-authored-by: Ken Jin <kenjin@python.org>
Co-authored-by: andrei kulakov <andrei.avk@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-05 13:58:36 +00:00
Miss Islington (bot)
68f05dd829
[3.12] gh-101100: Fix many easily solvable Sphinx nitpicks in the datamodel docs (GH-112737) (#112748)
gh-101100: Fix many easily solvable Sphinx nitpicks in the datamodel docs (GH-112737)
(cherry picked from commit 2f20cafdbf)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-05 10:06:11 +00:00
Serhiy Storchaka
f1a0c77f4e
[3.12] gh-62897: Update PyUnicode C API parameter names (GH-12680) (GH-112744)
Standardize PyUnicode C API parameter names across the documentation.

(cherry picked from commit b31232ddf7)

Co-authored-by: Rune Tynan <runetynan@gmail.com>
2023-12-05 11:30:44 +02:00
Miss Islington (bot)
85bbfa8a4b
[3.12] gh-112334: Restore subprocess's use of vfork() & fix extra_groups=[] behavior (GH-112617) (#112731)
Restore `subprocess`'s intended use of `vfork()` by default for performance on Linux;
also fixes the behavior of `extra_groups=[]` which was unintentionally broken in 3.12.0:

Fixed a performance regression in 3.12's :mod:`subprocess` on Linux where it
would no longer use the fast-path ``vfork()`` system call when it could have
due to a logic bug, instead falling back to the safe but slower ``fork()``.

Also fixed a security bug introduced in 3.12.0.  If a value of ``extra_groups=[]``
was passed to :mod:`subprocess.Popen` or related APIs, the underlying
``setgroups(0, NULL)`` system call to clear the groups list would not be made
in the child process prior to ``exec()``.

The security issue was identified via code inspection in the process of
fixing the first bug.  Thanks to @vain for the detailed report and
analysis in the initial bug on Github.

(cherry picked from commit 9fe7655c6c)

+ Reword NEWS for the bugfix/security release. (mentions the assigned CVE number)

Co-authored-by: Gregory P. Smith [Google LLC] <greg@krypto.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-04 23:33:59 +00:00
Miss Islington (bot)
494cd508c0
[3.12] gh-112671: Fixing typo in the Macro Docs (GH-112715) (GH-112726)
Replace Py_T_STRING_INLINE with Py_T_STRING_INPLACE
(cherry picked from commit a8ce149628)

Co-authored-by: Amioplk <amir.worms@dauphine.eu>
2023-12-04 20:58:04 +00:00
Miss Islington (bot)
88ec2a4fef
[3.12] gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615) (#112724)
gh-105967: Work around a macOS bug, limit zlib C library crc32 API calls to 1gig (GH-112615)

Work around a macOS bug, limit zlib crc32 calls to 1GiB.

Without this, `zlib.crc32` and `binascii.crc32` could produce incorrect
results on multi-gigabyte inputs depending on the macOS version's Apple
supplied zlib implementation.
(cherry picked from commit 4eddb4c9d9)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2023-12-04 20:29:23 +00:00
Miss Islington (bot)
8d21242bd1
[3.12] gh-108927: Fix removing testing modules from sys.modules (GH-108952) (ПР-112711)
It breaks import machinery if the test module has submodules used in
other tests.
(cherry picked from commit e08b70fab1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-04 16:17:38 +00:00
Alex Waygood
f49d07327a
[3.12] gh-101100: Fix Sphinx nitpicks in library/abc.rst (#112703) (#112705)
(cherry-picked from commit 9560e0d6d7)
2023-12-04 13:12:38 +00:00
Miss Islington (bot)
55896f470b
[3.12] gh-109786: Fix leaks and crash when re-enter itertools.pairwise.__next__() (GH-109788) (GH-112699)
(cherry picked from commit 6ca9d3e017)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-04 12:15:41 +00:00
Miss Islington (bot)
8d1b3c0a70
[3.12] gh-101100: Fix Sphinx nitpicks in library/functions.rst (GH-112669) (#112697)
gh-101100: Fix Sphinx nitpicks in `library/functions.rst` (GH-112669)
(cherry picked from commit cda737924f)

Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
2023-12-04 12:11:26 +00:00