Commit graph

49736 commits

Author SHA1 Message Date
Diego Russo
5da53d3024
[3.11] gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959) (#113167)
Fix the same issue of PR #112604 on PPC64LE platform
Refactor tests to make easier to add more platfroms if needed.

(cherry picked from commit 6644ca45cd)
Change-Id: I1ada30808c0d593a43eca3fa7a628c26bc276310
2024-01-05 16:38:20 +01:00
Miss Islington (bot)
456e2ecdd2
[3.11] gh-113538: Don't error in stream reader protocol callback when task is cancelled (GH-113690) (#113714)
(cherry picked from commit 4681a5271a)

Co-authored-by: Guido van Rossum <guido@python.org>
2024-01-04 20:39:52 +00:00
Miss Islington (bot)
93e9381e1c
[3.11] gh-113628: Fix test_site test with long stdlib paths (GH-113640) (#113672)
gh-113628: Fix test_site test with long stdlib paths (GH-113640)
(cherry picked from commit 5dc79e3d7f)

Co-authored-by: Itamar Oren <itamarost@gmail.com>
2024-01-03 01:02:14 +00:00
Miss Islington (bot)
1c381ec4ed
[3.11] gh-113602: Bail out when the parser tries to override existing errors (GH-113607) (#113653)
gh-113602: Bail out when the parser tries to override existing errors (GH-113607)
(cherry picked from commit 9ed36d533a)

Signed-off-by: Pablo Galindo <pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2024-01-02 13:22:39 +00:00
Serhiy Storchaka
36153494f1
[3.11] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) (GH-113624)
The length field of StgDictObject for Structure class contains now
the total number of items in ffi_type_pointer.elements (excluding
the trailing null).

The old behavior of using the number of elements in the parent class can
cause the array to be truncated when it is copied, especially when there
are multiple layers of subclassing.

(cherry picked from commit 5f3cc90a12)

Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
2024-01-01 16:46:07 +00:00
Miss Islington (bot)
ced2d35523
[3.11] gh-113543: Make sure that MacOSXOSAScript sends webbrowser.open audit event (GH-113544) (#113550)
gh-113543: Make sure that `MacOSXOSAScript` sends `webbrowser.open` audit event (GH-113544)
(cherry picked from commit fba324154e)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2023-12-29 09:57:21 +01:00
Miss Islington (bot)
a486d10fc6
[3.11] gh-57795: Add news to idlelib/News3.txt (GH-113522) (#113524)
gh-57795: Add news to idlelib/News3.txt (GH-113522)
(cherry picked from commit 6c98fce33a)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-27 21:10:39 +00:00
Miss Islington (bot)
f9d25b56e1
[3.11] gh-67641: Clarify documentation on bytes vs text with non-seeking tarfile stream (GH-31610) (GH-113520)
(cherry picked from commit 0651936ae2)

Co-authored-by: Stanley <46876382+slateny@users.noreply.github.com>
2023-12-27 17:33:00 +00:00
Miss Islington (bot)
54927cd21a
[3.11] 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-113518)
(cherry picked from commit c66b577d9f)

Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
2023-12-27 19:03:45 +02:00
Miss Islington (bot)
a1f0118a26
[3.11] gh-57795: IDLE: Enter the selected text when opening the "Replace" dialog (GH-17593) (GH-113515)
(cherry picked from commit 712afab5ac)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Roger Serwy <roger.serwy@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-27 14:43:59 +00:00
Serhiy Storchaka
f1951900f1
[3.11] bpo-36959: Fix error messages for invalid ISO format string in _strptime() (GH-13408) (GH-113499)
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>
2023-12-26 20:09:41 +00:00
Miss Islington (bot)
1cc594d571
[3.11] bpo-37013: Fix the error handling in socket.if_indextoname() (GH-13503) (GH-112598)
* 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:27 +02:00
Miss Islington (bot)
1162d29f5b
[3.11] gh-76785: Make test.test_interpreters executable (GH-112982) (GH-113470) (GH-113473)
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.
(cherry picked from commit bdad5c367f)

Co-authored-by: Jeff Allen <ja.py@farowl.co.uk>
2023-12-25 18:46:44 +00:00
Miss Islington (bot)
88cc19b530
[3.11] gh-113440: Ignore the "ver" command failure with exit code 0xc0000142 (GH-113435) (GH-113452)
(cherry picked from commit 53330f1677)

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

Co-authored-by: Xu Song <xusong.vip@gmail.com>
2023-12-24 10:22:34 +00:00
Miss Islington (bot)
336d445934
[3.11] gh-113028: Correctly memoize str in pickle when escapes added (GH-113436) (GH-113449)
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:53 +00:00
Miss Islington (bot)
b60bddbde2
[3.11] gh-112559: Avoid unnecessary conversion attempts to enum_klass in signal.py (GH-113040) (#113444)
gh-112559: Avoid unnecessary conversion attempts to enum_klass in signal.py (GH-113040)
(cherry picked from commit 050783cb37)

Co-authored-by: Yilei Yang <yileiyang@google.com>
2023-12-23 18:09:46 -08:00
Miss Islington (bot)
9000b8a713
[3.11] gh-109989: Fix test_c_locale_coercion when PYTHONIOENCODING is set (GH-113378) (#113399)
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:58:18 +01:00
Serhiy Storchaka
fe2b4dd3c0
[3.11] gh-81682: Fix test failures when CPython is built without docstrings (GH-113410) (GH-113430)
(cherry picked from commit 4e5b27e6a3)
2023-12-23 11:38:07 +00:00
Miss Islington (bot)
80b2bad2c2
[3.11] gh-113188: Fix shutil.copymode() and shutil.copystat() on Windows (GH-113285) (GH-113426)
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.
(cherry picked from commit c7874bb56f)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-23 12:53:48 +02:00
Miss Islington (bot)
e59ad5796e
[3.11] gh-113384: Skip test_freeze for framework builds on macOS (GH-113390) (#113396)
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:07:07 +01:00
Miss Islington (bot)
9cbe4738bc
[3.11] GH-113214: Fix SSLProto exception handling in SSL-over-SSL scenarios (GH-113334) (#113340)
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:51 -08:00
Alex Waygood
d65dfc8238
[3.11] gh-113255: Clarify docs for typing.reveal_type (#113286) (#113326)
(cherry-picked from commit 11ee912327)

Co-authored-by: Kir <note351@hotmail.com>
2023-12-20 18:35:13 +00:00
Miss Islington (bot)
5e0d9aea99
[3.11] gh-102362: Fix macOS version number in result of sysconfig.get_platform() (GH-112942) (#113265)
gh-102362: Fix macOS version number in result of sysconfig.get_platform() (GH-112942)

Change _osx_support.get_platform_osx() to make sure that the
version number in the result includes at least a major and
minor version (e.g. 14.2) even if MACOSX_DEPLOYMENT_TARGET is
set to just a major version (e.g. 14).

This matches the versions expected by pip when selecting
appropriate wheels for installation.
(cherry picked from commit 893c9ccf48)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2023-12-19 19:57:08 +01:00
Miss Islington (bot)
1dd2ad6f8e
[3.11] gh-113269: IDLE - Fix test_editor hang (macOS) (GH-113271) (#113273)
gh-113269: IDLE - Fix test_editor hang (macOS) (GH-113271)

Hangs on installed 3.13.0a2 on macOS Catalina.
Behavior on installed 3.12.1 and 3.11.7 is unknown.
(cherry picked from commit fa9ba02353)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-19 05:42:59 +00:00
Miss Islington (bot)
44bdb6d55c
[3.11] gh-113199: Make read1() and readline() of HTTPResponse close IO after reading all data (GH-113200) (GH-113260)
(cherry picked from commit 41336a72b9)

Co-authored-by: Illia Volochii <illia.volochii@gmail.com>
2023-12-18 20:34:15 +00:00
Stéphane Bidoul
2cd3564738
[3.11] gh-113246: Updated bundled pip to 23.3.2 (gh-113249) (#113254)
Updated bundled pip to 23.3.2.
(cherry picked from commit 4a24bf9a13)
2023-12-18 11:34:58 +00:00
Miss Islington (bot)
fbaf00ee57
[3.11] IDLE: Add util and stub example comments (GH-113222) (#113224)
(cherry picked from commit cde1335485)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-17 01:20:36 +00:00
Miss Islington (bot)
220fae7706
[3.11] gh-113009: Fix multiprocessing Process.terminate() on Windows (GH-113128) (#113178)
gh-113009: Fix multiprocessing Process.terminate() on Windows (GH-113128)

On Windows, Process.terminate() no longer sets the returncode
attribute to always call WaitForSingleObject() in Process.wait().
Previously, sometimes the process was still running after
TerminateProcess() even if GetExitCodeProcess() is not STILL_ACTIVE.
(cherry picked from commit 4026ad5b2c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2023-12-15 15:20:18 +00:00
Miss Islington (bot)
6ff7c1311f
[3.11] gh-61648: Detect line numbers of properties in doctests (GH-113161) (GH-113165)
(cherry picked from commit 8f8f0f97e1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-15 13:38:45 +00:00
Serhiy Storchaka
d4234937a1
[3.11] gh-112716: Fix SystemError when __builtins__ is not a dict (GH-112770) (GH-113105)
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:59:33 +00:00
Miss Islington (bot)
08ff6fa23d
[3.11] gh-113090: Fix test.support.os_support.can_chmod() on Windows (GH-113091) (GH-113100)
(cherry picked from commit c6e953be12)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-14 14:01:01 +02:00
Miss Islington (bot)
e4cdb74079
[3.11] gh-113086: Add tests for os.chmod() and os.lchmod() (GH-113087) (GH-113089)
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:33:35 +00:00
Miss Islington (bot)
a45a059afe
[3.11] bpo-40648: Test modes that file can get with chmod() on Windows (GH-20130) (GH-113069)
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:48:43 +00:00
Miss Islington (bot)
5fd915df6e
[3.11] [pprint]: Add docstring about PrettyPrinter.underscore_numbers parameter (GH-112963) (#113052)
[pprint]: Add docstring about `PrettyPrinter.underscore_numbers` parameter (GH-112963)
(cherry picked from commit 2a3c37c273)

Co-authored-by: Sequew <88668176+KrySeyt@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2023-12-13 12:38:19 +00:00
Serhiy Storchaka
f78f6b6e89
[3.11] gh-112999: Replace the outdated "deprecated" directives with "versionchanged" (GH-113000) (GH-113020)
(cherry picked from commit fe9991bb67)
2023-12-12 17:17:35 +00:00
Miss Islington (bot)
11f9502192
[3.11] [3.12] gh-83162: Rename re.error in idlelib (GH-101677) (GH-112987) (#113013)
Backport idlelib part of GH-101677 with simple rename.
(cherry picked from commit fd3b894725)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2023-12-12 16:21:07 +00:00
Terry Jan Reedy
ada2d77977
[3.11] gh-112953: Rename idlelib/NEWS.txt to News3.txt and update (GH… (#112992) 2023-12-12 06:10:29 +00:00
Miss Islington (bot)
70e50c0756
[3.11] gh-108303: Move double_const to test_import where it belongs (GH-112108) (#112977)
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 18:46:02 +00:00
Miss Islington (bot)
5aec2d2452
[3.11] gh-94606: Fix error when message with Unicode surrogate not surrogateescaped string (GH-94641) (GH-112972)
(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:47:25 +00:00
Miss Islington (bot)
a37e1473da
[3.11] gh-112898: warn about unsaved files when quitting IDLE on macOS (GH-112939) (#112961)
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:45 +01:00
Miss Islington (bot)
449fdfca96
[3.11] Fix SyntaxWarning in test_syntax.py (GH-112944) (GH-112956)
(cherry picked from commit 97cd45bfdb)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2023-12-11 12:09:03 +00:00
Miss Islington (bot)
95f5c8c46c
[3.11] gh-109980: Fix test_tarfile_vs_tar on macOS (GH-112905) (#112928)
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:50:10 +01:00
Miss Islington (bot)
671f3d3ccd
[3.11] IDLE: Tweak iomenu.IOBinding.maybesave (GH-112914) (#112918)
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:07 +00:00
Miss Islington (bot)
2d8012f852
[3.11] gh-79429: Ignore FileNotFoundError when remove a temporary directory in the multiprocessing finalizer (GH-112865) (GH-112897)
(cherry picked from commit 7e82c626c4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2023-12-09 13:31:42 +00:00
Łukasz Langa
1e6d36da1e
[3.11] gh-110190: Temporarily skip new test introduced in gh-112604 on PPC64LE (GH-112818) (#112830)
(cherry picked from commit 9f67042f28)
2023-12-08 12:47:32 +01:00
Miss Islington (bot)
1eac0aab85
[3.11] gh-110017: Disable test_signal.test_stress_modifying_handlers on macOS (GH-112834) (#112852)
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:08:04 +01:00
Serhiy Storchaka
a18201bff1
[3.11] gh-79325: Fix recursion error in TemporaryDirectory cleanup on Windows (GH-112762) (GH-112848)
(cherry picked from commit b2923a61a1)
2023-12-07 17:46:30 +00:00
Serhiy Storchaka
5585334d77
[3.11] gh-91133: tempfile.TemporaryDirectory: fix symlink bug in cleanup (GH-99930) (GH-112839)
(cherry picked from commit 81c16cd94e)

Co-authored-by: Søren Løvborg <sorenl@unity3d.com>
2023-12-07 18:37:10 +02:00
Miss Islington (bot)
666a484d29
[3.11] gh-109981: Fix support.fd_count() on macOS 14 (GH-112797) (#112825)
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:54 +01:00