Commit graph

32539 commits

Author SHA1 Message Date
Tomas R.
ae775dcc24
[3.13] gh-130197: Improve test coverage of msgfmt.py (GH-133048) (GH-133255)
(cherry picked from commit c73d46076e)
2025-05-02 07:28:28 +00:00
Miss Islington (bot)
766c5f75b9
[3.13] gh-119605: Respect follow_wrapped for __init__ and __new__ when getting class signature with inspect.signature (GH-132055) (#133277)
gh-119605: Respect `follow_wrapped` for `__init__` and `__new__` when getting class signature with `inspect.signature` (GH-132055)
(cherry picked from commit b8633f9aca)

Co-authored-by: Xuehai Pan <XuehaiPan@pku.edu.cn>
2025-05-01 20:06:07 -07:00
Miss Islington (bot)
f7d1109a12
[3.13] gh-133210: Fix test_inspect in --without-doc-strings mode (GH-133250) (#133263)
gh-133210: Fix `test_inspect` in `--without-doc-strings` mode (GH-133250)
(cherry picked from commit 27e011455d)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-05-01 16:36:12 +00:00
Miss Islington (bot)
90c786e377
[3.13] gh-130655: Add a test for big-endian MO files in gettext (GH-132469) (GH-133248)
(cherry picked from commit 474f296718)

Co-authored-by: Tomas R <tomas.roun8@gmail.com>
2025-05-01 11:36:06 +00:00
Miss Islington (bot)
704a3f8c0a
[3.13] gh-133167: Fix compilation process with --enable-optimizations and --without-docstrings (GH-133187) (#133207)
gh-133167: Fix compilation process with `--enable-optimizations` and `--without-docstrings` (GH-133187)
(cherry picked from commit cc39b19f0f)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-30 14:06:31 +00:00
Miss Islington (bot)
dfaa384991
[3.13] gh-132308: prevent TracebackException swallowing attributes of a falsey Exception or ExceptionGroup (GH-132363) (#132725)
gh-132308: prevent `TracebackException` swallowing attributes of a falsey `Exception` or `ExceptionGroup` (GH-132363)
(cherry picked from commit 69cda31261)

Co-authored-by: Duprat <yduprat@gmail.com>
2025-04-30 09:19:53 +02:00
Mark Shannon
132bdf6990
[3.13] GH-127682: Backport GH-132351 (GH-132384)
Only call `__iter__` once in generator expressions
2025-04-29 09:35:29 +01:00
Neil Schemenauer
64dcbb0c31
[3.13] gh-133122: Fix for test_type_lookup_mro_reference. (gh-133127)
Change the unit test case to use `getattr()` so that we avoid the
bytecode specializer optimizing the access.  The specializer will call
the `__eq__` method before the unit test expects, causing it to fail.

In the 3.14 branch (gh-128164) the test is changed in a different way
to avoid the same issue.
2025-04-29 03:33:13 +00:00
Miss Islington (bot)
b71442f44f
[3.13] gh-132742: Fix newly added tcflush() tests on Android (GH-133070) (GH-133104)
(cherry picked from commit 25186c2472)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-28 19:10:42 +00:00
sobolevn
ab89f6ec84
[3.13] gh-133054: Skip test_pyrepl tests when cannot use pyrepl is reported (GH-133055) (#133095)
(cherry picked from commit b739ec5ab7)

Co-authored-by: Tomas R. <tomas.roun8@gmail.com>
2025-04-28 18:00:42 +00:00
Serhiy Storchaka
0d53872443
[3.13] gh-132742: Improve tests for fcntl.ioctl() (GH-132791) (GH-133066)
* Use better tests for integer argument.
* Add also parallel tests for tcflush() and tcflow().
(cherry picked from commit ed8e886f4f)
2025-04-28 08:23:43 +00:00
Miss Islington (bot)
8fdc10686b
[3.13] [tests] fix test_fcntl issue when run in a ChromeOS linux runtime (GH-133053) (GH-133056)
[tests] fix test_fcntl issue when run in a ChromeOS linux runtime (GH-133053)

* [tests] test_fcntl fails when run in a ChromeOS linux runtime container.

It doesn't appear to support F_NOTIFY? Detect the lack of that and skip the test.
(cherry picked from commit 355ee1a429)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2025-04-27 20:54:37 +00:00
Miss Islington (bot)
fdcaaad1cc
[3.13] gh-63882: Implement some test_minidom tests (GH-132879) (#133029)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Julian Gindi <julian@gindi.io>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-26 20:28:00 +00:00
Miss Islington (bot)
3a1a2a0b49
[3.13] gh-133016: Fix a reference to removed asyncio.futures.TimeoutError (GH-133019) (#133023)
gh-133016: Fix a reference to removed `asyncio.futures.TimeoutError` (GH-133019)

Just use the builtin `TimeoutError`, and remove the import of `futures`.
(cherry picked from commit 8d6d7386a3)

Co-authored-by: John <john-xyz@outlook.com>
2025-04-26 19:46:11 +00:00
Miss Islington (bot)
4031902949
[3.13] gh-63882: Use self.assert* methods in test_minidom (GH-133000) (#133024)
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
2025-04-26 19:21:22 +00:00
Miss Islington (bot)
41e19a78b2
[3.13] gh-91221: fix test_curses.test_use_default_colors for xterm-256color (GH-132990) (#132992)
gh-91221: fix `test_curses.test_use_default_colors` for xterm-256color (GH-132990)

Terminals with `xterm-256color` Xterm support may use 15 (bright white) as their default foreground color.
(cherry picked from commit 7f02ded29f)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-26 11:02:17 +00:00
Miss Islington (bot)
08772229c7
[3.13] gh-132684: [Enum] only call _missing_ in __contains__ for Flags (GH-132790) (GH-132896)
gh-132684: [Enum] only call _missing_ in __contains__ for Flags (GH-132790)
(cherry picked from commit 22bc953aa9)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-25 13:30:33 -07:00
Miss Islington (bot)
b4a160ac59
[3.13] gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906) (#132916)
gh-132415: Use shutil.which() in missing_compiler_executable() (GH-132906)

Replace deprecated distutils.spawn.find_executable() with
shutil.which() in missing_compiler_executable() of test.support.
(cherry picked from commit de6482eda3)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-25 10:41:40 +00:00
Miss Islington (bot)
8a759c235c
[3.13] gh-127906: Add missing sys import to test_cppext (GH-132902) (#132904)
gh-127906: Add missing sys import to test_cppext (GH-132902)
(cherry picked from commit 9cba14881b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-25 08:42:57 +00:00
Serhiy Storchaka
bf6c74dc7a
[3.13] Use os.openpty() instead of pty.openpty() in test_ioctl (GH-132878)
pty.openpty() does not work on Android, and it is easier to check
availability of os.openpty.
2025-04-24 18:47:01 +03:00
Miss Islington (bot)
b220c1c0a4
[3.13] gh-109981: Resolve situation on iOS regarding fd_count. (GH-132823) (#132824)
Modifies the test helper that counts the list of open file descriptors to use
the optimised ``/dev/fd`` approach on all Apple platforms, not just macOS. This
avoids crashes caused by guarded file descriptors.
(cherry picked from commit 862fd89036)

Co-authored-by: John <johnzhou721@gmail.com>
2025-04-23 21:40:25 +00:00
Serhiy Storchaka
f8d4ca42ae
[3.13] gh-83994, gh-132843: Fix and improve test_ioctl (GH-132848) (GH-132850)
* Skip test_ioctl_tcflush if termios.TCFLSH is not available.
* Do not skip ALL ioctl() tests when /dev/tty is not available.
(cherry picked from commit 4b4b9fbb06)
2025-04-23 19:17:51 +00:00
Victor Stinner
3de0f55f34
[3.13] gh-132713: Fix repr(list) race condition (#132801) (#132809)
Hold a strong reference to the item while calling repr(item).

(cherry picked from commit a4ea80d523)
2025-04-23 15:44:33 +02:00
Gregory P. Smith
cdabbc126f
[3.13] gh-122179: Fix hashlib.file_digest and non-blocking I/O (GH-132787)
gh-122179: Fix hashlib.file_digest and non-blocking I/O (GH-122183)

* Fix hashlib.file_digest and non-blocking I/O
* Add documentation around this behavior
* Add versionchanged

(cherry picked from commit 2b47f46d7d)

Co-authored-by: Sebastian Rittau <srittau@rittau.biz>
2025-04-21 21:55:57 +00:00
Peter Bierma
bb59fdec71
[3.13] gh-132747: Fix NULL dereference when calling a method's __get__ manually (GH-132772) (#132786)
(cherry picked from commit fa70bf8593)

Co-authored-by: Peter Bierma <zintensitydev@gmail.com>
2025-04-21 21:38:51 +00:00
Serhiy Storchaka
3c29fb2974
[3.13] gh-132753: Argument Clinic: Fix support of c_default for the bool converter (GH-132754) (GH-132766)
(cherry picked from commit 78cfee6f09)
2025-04-21 07:10:31 +00:00
Miss Islington (bot)
c709d3b503
[3.13] gh-132742: Add more tests for fcntl.ioctl() (GH-132756) (GH-132764)
Test with different types of argument: integer, mutable and immutable
buffers, immutable buffer with mutable_flag set to false.
(cherry picked from commit a04390b4da)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-21 06:49:45 +00:00
Miss Islington (bot)
62663bfed5
[3.13] gh-129098: avoid using content of _pyrepl/__main__.py when reporting tracebacks (GH-130721) (#132755)
gh-129098: avoid using content of `_pyrepl/__main__.py` when reporting tracebacks (GH-130721)
(cherry picked from commit 492e3e6976)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-20 17:48:16 +00:00
Peter Bierma
47c8df6172
[3.13] gh-132673: Fix a crash with zero-alignment in ctypes.Structure (#132695) 2025-04-19 14:29:05 +00:00
Miss Islington (bot)
10f37b36b4
[3.13] gh-132396: Resolve 'redefinition of unused name' errors in `Lib/test/` (GH-132397) (#132699)
gh-132396: Resolve 'redefinition of unused name' errors in ``Lib/test/`` (GH-132397)
(cherry picked from commit 1d5dc5f1c3)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2025-04-18 20:35:35 +01:00
Łukasz Langa
a37d719d37
[3.13] gh-129958: Properly disallow newlines in format specs in single-quoted f-strings (GH-130063) (GH-132692)
(cherry picked from commit 2f8b08da47)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-04-18 17:41:42 +02:00
Miss Islington (bot)
b3d4980c56
[3.13] gh-132553: Build the perf tool without buildid cache (GH-132663) (GH-132681)
(cherry picked from commit e01e582902)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2025-04-18 12:51:02 +00:00
Bartosz Sławecki
582d1ef463
[3.13] gh-130070: Fix exec(<string>, closure=<non-None>) unexpected path (GH-130071) (#132627)
gh-130070: Fix `exec(<string>, closure=<non-None>)` unexpected path (#130071)

Fixed an assertion error (so, it could be reproduced only in builds with assertions enabled)
for `exec` when the `source` argument is a string and the `closure` argument is not `None`.

Co-authored-by: sobolevn <mail@sobolevn.me>
(cherry picked from commit 954b2cf031)
2025-04-17 09:21:56 +00:00
Miss Islington (bot)
88d95c3529
[3.13] typing: Add missing test case for Protocol inheritance (GH-132597) (#132603)
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
2025-04-16 15:45:29 +00:00
Miss Islington (bot)
ee8f681252
[3.13] gh-130941: Fix configparser parsing values with allow_no_value and interpolation set (GH-130949) (#132588)
gh-130941: Fix `configparser` parsing values with `allow_no_value` and `interpolation` set (GH-130949)
(cherry picked from commit c35c7353eb)

Co-authored-by: sobolevn <mail@sobolevn.me>
2025-04-16 14:19:46 +02:00
Miss Islington (bot)
8128bcfa08
[3.13] gh-127591: Fix altering environment in test_urllib2 (unsetting no_proxy) (GH-132584) (GH-132585)
(cherry picked from commit 8b7cb947c5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-16 11:06:53 +00:00
Miss Islington (bot)
08faa2aeac
[3.13] gh-132535: Fix resource warnings in test_timeout (GH-132572) (GH-132580)
They were emitted if internet connection was not available.
(cherry picked from commit 82f74eb234)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-16 07:44:47 +00:00
Miss Islington (bot)
a3a3bfd01c
[3.13] gh-114713: Handle case of an empty string passed to zoneinfo.ZoneInfo (GH-114731) (#132563)
gh-114713: Handle case of an empty string passed to `zoneinfo.ZoneInfo` (GH-114731)
(cherry picked from commit 884df116d7)

Co-authored-by: Bogdan Romanyuk <65823030+wrongnull@users.noreply.github.com>
Co-authored-by: Stan Ulbrych <89152624+StanFromIreland@users.noreply.github.com>
Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2025-04-15 19:05:28 +00:00
Miss Islington (bot)
6d48194d9f
[3.13] gh-132176: Fix crash on type() when tuple subclass passed as bases (GH-132212) (#132548)
gh-132176: Fix crash on `type()` when `tuple` subclass passed as `bases` (GH-132212)
(cherry picked from commit b6c552f9e6)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Victor Stinner <vstinner@python.org>
2025-04-15 11:38:20 +00:00
Serhiy Storchaka
d321b6ec82
[3.13] gh-132099: Harmonize Bluetooth address handling (GH-132486) (GH-132497)
Now all protocols always accept the Bluetooth address as string and
getsockname() always returns the Bluetooth address as string.

* BTPROTO_SCO now accepts not only bytes, but str.
* BTPROTO_SCO now checks address for embedded null.
* On *BSD, BTPROTO_HCI now accepts str instead of bytes.
* On FreeBSD, getsockname() for BTPROTO_HCI now returns str instead of bytes.
* On NetBSD and DragonFly BSD, BTPROTO_HCI now checks address for embedded null.
(cherry picked from commit 1fc1df8dcc)
2025-04-14 19:36:04 +03:00
Miss Islington (bot)
a50aa3325b
[3.13] gh-132515: de-duplicate test_dataclass_derived_generic_from_slotted_base (GH-132516) (#132518)
gh-132515: de-duplicate `test_dataclass_derived_generic_from_slotted_base` (GH-132516)
(cherry picked from commit 45c447bf91)

Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
2025-04-14 15:29:20 +00:00
Tomas R.
5f1eaff5b5
[3.13] gh-132435: Test syntax warnings in a finally block (GH-132436) (GH-132503)
(cherry picked from commit 887eabc5a7)
2025-04-14 10:21:36 +03:00
Miss Islington (bot)
ff9198dab3
[3.13] gh-124986: Fix test_no_leaking in test_subprocess on NetBSD and FreeBSD (GH-132476) (GH-132498)
On platforms where the file descriptor limit is larger than FD_SETSIZE
that test was always skipped (FreeBSD) or always failing (NetBSD).
(cherry picked from commit f7b24ffefd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-14 06:38:13 +00:00
Vinay Sajip
1dcdac6e08
[3.13] gh-132106: Ensure that running `logging.handlers.QueueListener… (GH-132471)
Cherry-picked using 5863cd70b8
2025-04-13 13:00:50 +01:00
Tomas R.
4ff5d88fb1
[3.13] gh-131927: Prevent emitting compiler warnings twice (GH-131993) (GH-132463)
(cherry picked from commit 3d08c8ad20)
2025-04-13 08:42:04 +00:00
Miss Islington (bot)
f943376ca8
[3.13] gh-132185: Speed up expanduser() test with large password database (GH-132231) (GH-132443)
Use only a limited number of randomly selected entries.
(cherry picked from commit 842ab81517)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-12 16:43:28 +00:00
Miss Islington (bot)
70c4bd63d4
[3.13] gh-58211: Add tests for the __self__ attribute of builtins functions (GH-113575) (#132437)
gh-58211: Add tests for  the `__self__` attribute of builtins functions (GH-113575)

---------
(cherry picked from commit 891465fc7a)

Co-authored-by: Adorilson Bezerra <adorilson@gmail.com>
Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Bénédikt Tran <10796600+picnixz@users.noreply.github.com>
Co-authored-by: Sergey B Kirpichev <skirpichev@gmail.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2025-04-12 12:25:51 +00:00
Miss Islington (bot)
0aabe44fa8
[3.13] GH-132417: ctypes: Fix potential Py_DECREF(NULL) when handling functions returning PyObject * (GH-132418) (#132425)
GH-132417: ctypes: Fix potential `Py_DECREF(NULL)` when handling functions returning `PyObject *` (GH-132418)

Some functions (such as `PyErr_Occurred`) with a `restype` set to `ctypes.py_object` may return NULL without setting an exception.
(cherry picked from commit 2aab2db146)

Co-authored-by: Nicolas Trangez <ikke@nicolast.be>
2025-04-12 09:14:07 +00:00
Miss Islington (bot)
089c43f160
[3.13] gh-132356: Find the correct group name in test_group_no_follow_symlinks (GH-132357) (#132404)
gh-132356: Find the correct group name in test_group_no_follow_symlinks (GH-132357)

Find the correct group name in test_group_no_follow_symlinks
(cherry picked from commit 3e1a47bdb4)

Co-authored-by: Karolina Surma <33810531+befeleme@users.noreply.github.com>
2025-04-11 15:24:16 +00:00
Miss Islington (bot)
2b61f6ac39
[3.13] gh-132316: Require socket and GITHUB_TOKEN env to use GitHubArtifactDatabase (GH-132348) (#132367)
gh-132316: Require `socket` and `GITHUB_TOKEN` env to use `GitHubArtifactDatabase` (GH-132348)
(cherry picked from commit fcf2d07228)

Co-authored-by: sobolevn <mail@sobolevn.me>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
2025-04-10 15:15:58 +00:00