Commit graph

30238 commits

Author SHA1 Message Date
Miss Islington (bot)
b8207711ce
[3.12] bpo-26791: Update shutil.move() to provide the same symlink move behavior as the mv shell when moving a symlink into a directory that is the target of the symlink (GH-21759) (GH-113517)
(cherry picked from commit c66b577d9f)

Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
2023-12-27 19:03:30 +02:00
Miss Islington (bot)
ba3e19a5d7
[3.12] gh-111615: Fix regression in QueueHandler configuration. (GH-111638) (GH-113507) 2023-12-27 14:20:36 +00:00
Miss Islington (bot)
a3f53a006c
[3.12] bpo-36959: Fix error messages for invalid ISO format string in _strptime() (GH-13408) (GH-113495)
Previously some error messages complained about incompatible
combinations of directives that are not contained in the format string.

(cherry picked from commit 4b2c3e8e43)

Co-authored-by: Gordon P. Hemsley <me@gphemsley.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-26 21:56:42 +02:00
Miss Islington (bot)
1cf576a358
[3.12] gh-113468: Remove the "_new_ suffix from class names in pydocfodder (GH-113469) (GH-113483)
(cherry picked from commit 8a3d0e4a66)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-26 11:27:18 +00:00
Miss Islington (bot)
fc7e67f51a
[3.12] bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503) (GH-112597)
* Fix a crash when pass UINT_MAX.
* Fix an integer overflow on 64-bit non-Windows platforms.
(cherry picked from commit 0daf555c6f)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2023-12-25 20:55:08 +02:00
Jeff Allen
bdad5c367f
[3.12] gh-76785: Make test.test_interpreters executable (GH-112982) (GH-113470)
This is so that we can run python -m test.test_interpreters. As such it
backports that aspect of commit 86a77f4e1a,
where it is implemented by a package __main__.py.
2023-12-25 20:31:57 +02:00
Miss Islington (bot)
fbfb90c820
[3.12] gh-113440: Ignore the "ver" command failure with exit code 0xc0000142 (GH-113435) (GH-113453)
(cherry picked from commit 53330f1677)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-24 10:49:34 +00:00
Miss Islington (bot)
1bff2fd013
[3.12] gh-113421: Fix multiprocessing logger for "%(filename)s" (GH-113423) (GH-113450)
(cherry picked from commit ce77ee5035)

Co-authored-by: Xu Song <xusong.vip@gmail.com>
2023-12-24 10:23:32 +00:00
Miss Islington (bot)
269cb342ad
[3.12] gh-113028: Correctly memoize str in pickle when escapes added (GH-113436) (GH-113448)
This fixes a divergence between the Python and C implementations of pickle
for protocol 0, such that it pickle.py fails to re-use the first pickled
representation of strings involving characters that have to be escaped.
(cherry picked from commit 08398631a0)

Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
2023-12-24 10:01:08 +00:00
Miss Islington (bot)
7f2ebc84e8
[3.12] gh-112559: Avoid unnecessary conversion attempts to enum_klass in signal.py (GH-113040) (#113443)
(cherry picked from commit 050783cb37)

Co-authored-by: Yilei Yang <yileiyang@google.com>
2023-12-23 18:09:59 -08:00
Miss Islington (bot)
8f526d3c9a
[3.12] gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set (GH-113378) (#113398)
gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set (GH-113378)

* gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set

This fixes the existing tests when PYTHONIOENCODING is
set by unsetting PYTHONIOENCODING.

Also add a test that explicitly checks what happens
when PYTHONIOENCODING is set.

(cherry picked from commit 5f665e99e0)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-23 21:57:54 +01:00
Irit Katriel
9d72a5cae7
[3.12] gh-113297: Fix segfault in compiler for with statement with 19 context managers (#113327) (#113404) 2023-12-23 13:29:11 +00:00
Serhiy Storchaka
fc4d2c3dc6
[3.12] gh-81682: Fix test failures when CPython is built without docstrings (GH-113410) (GH-113429)
(cherry picked from commit 4e5b27e6a3)
2023-12-23 11:50:01 +00:00
Serhiy Storchaka
c7874bb56f
[3.12] gh-113188: Fix shutil.copymode() and shutil.copystat() on Windows (GH-113285)
Previously they worked differenly if dst is a symbolic link:
they modified the permission bits of dst itself rather than the file
it points to if follow_symlinks is true or src is not a symbolic link,
and did nothing if follow_symlinks is false and src is a symbolic link.
2023-12-23 10:31:52 +00:00
Miss Islington (bot)
4259acd394
[3.12] gh-113384: Skip test_freeze for framework builds on macOS (GH-113390) (#113395)
gh-113384: Skip test_freeze for framework builds on macOS (GH-113390)
(cherry picked from commit bee627c1e2)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-22 12:06:46 +01:00
Miss Islington (bot)
192711856b
[3.12] GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios (GH-113334) (#113339)
When wrapped, `_SSLProtocolTransport._force_close(exc)` is called just like in the unwrapped scenario `_SelectorTransport._force_close(exc)` or `_ProactorBasePipeTransport._force_close(exc)` would be called, except here the exception needs to be passed through the `SSLProtocol._abort()` method, which didn't accept an exception object.

This commit ensures that this path works, in the same way that the uvloop implementation of SSLProto passes on the exception (on which the current implementation of SSLProto is based).

(cherry picked from commit 1ff0238594)

Co-authored-by: Martijn Pieters <mj@zopatista.com>
2023-12-20 16:51:36 -08:00
Miss Islington (bot)
816b635124
[3.12] gh-113199: Make read1() and readline() of HTTPResponse close IO after reading all data (GH-113200) (GH-113259)
(cherry picked from commit 41336a72b9)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2023-12-18 20:36:45 +00:00
Miss Islington (bot)
ded4307fc1
[3.12] gh-61648: Detect line numbers of properties in doctests (GH-113161) (GH-113164)
(cherry picked from commit 8f8f0f97e1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-15 13:44:45 +00:00
Serhiy Storchaka
59a22d3e50
[3.12] gh-112716: Fix SystemError when __builtins__ is not a dict (GH-112770) (GH-113103)
It was raised in two cases:
* in the import statement when looking up __import__
* in pickling some builtin type when looking up built-ins iter, getattr, etc.

(cherry picked from commit 1161c14e8c)
2023-12-14 12:54:25 +00:00
Miss Islington (bot)
913051d2a0
[3.12] gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091) (GH-113099)
(cherry picked from commit c6e953be12)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-14 14:00:40 +02:00
Miss Islington (bot)
9f5209f3c2
[3.12] gh-111049: Fix crash during garbage collection of the BytesIO buffer object (GH-111221) (GH-113096)
(cherry picked from commit bb36f72efc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-14 10:28:57 +00:00
Miss Islington (bot)
0bd18997d3
[3.12] gh-113086: Add tests for os.chmod() and os.lchmod() (GH-113087) (GH-113088)
Also make test_copymode_symlink_to_symlink in test_shutil more strict.
(cherry picked from commit b4f2c89118)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-14 07:31:46 +00:00
Miss Islington (bot)
338a5a5f0b
[3.12] bpo-40648: Test modes that file can get with chmod() on Windows (GH-20130) (GH-113070)
Order of tests matter second part makes testing file writable and
possible to remove again.
(cherry picked from commit f5c05e015c)

Co-authored-by: Pavol Babinčák‏ <scroolik@gmail.com>
2023-12-13 20:50:50 +00:00
Miss Islington (bot)
ac8adf97c4
[3.12] gh-108303: Move double_const to test_import where it belongs (GH-112108) (#112976)
gh-108303: Move `double_const` to `test_import` where it belongs (GH-112108)
(cherry picked from commit 0738b9a338)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-11 19:00:45 +00:00
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
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)
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)
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
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)
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
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)
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)
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)
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)
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
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)
29a5ff0068
[3.12] gh-112625: Protect bytearray from being freed by misbehaving iterator inside bytearray.join (GH-112626) (GH-112693)
(cherry picked from commit 0e732d0997)

Co-authored-by: chilaxan <chilaxan@gmail.com>
2023-12-04 08:46:40 +00:00
Irit Katriel
f5965c2385
[3.12] gh-112645: remove deprecation warning for use of onerror in shutil.rmtree (#112659) (#112665)
gh-112645: remove deprecation warning for use of onerror in shutil.rmtree (#112659)

(cherry picked from commit 97857ac058)
2023-12-03 16:28:57 +00:00
Alex Waygood
2a378ca2ef
[3.12] gh-112618: Make Annotated cache typed (#112619) (#112628) 2023-12-03 00:41:03 +00:00
Alex Waygood
acc62db8af
[3.12] gh-109413: libregrtest: Backport .py-file changes from #112558 (#112605) 2023-12-01 18:54:38 +00:00
Alex Waygood
36dbebed44
[3.12] gh-109413: libregrtest: enable mypy's --strict-optional check on most files (#112586) (#112602)
gh-109413: libregrtest: enable mypy's `--strict-optional` check on most files (#112586)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-01 17:13:22 +00:00
Miss Islington (bot)
4f919cf8b9
[3.12] gh-109413: regrtest: add WorkerRunTests class (GH-112588) (#112593)
gh-109413: regrtest: add WorkerRunTests class (GH-112588)
(cherry picked from commit f8ff80f635)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-01 14:46:42 +00:00
Miss Islington (bot)
7eff607deb
[3.12] gh-111058: Change coro.cr_frame/gen.gi_frame to be None for a closed coroutine/generator. (GH-112428) (#112589) 2023-12-01 14:13:15 +00:00