Commit graph

50940 commits

Author SHA1 Message Date
Miss Islington (bot)
205ac6eecf
[3.12] gh-114100: Remove superfluous writing to fd 1 in test_pty (GH-114647) (GH-114655)
(cherry picked from commit 7a470541e2)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-27 19:29:48 +02:00
Miss Islington (bot)
fd8aafd64d
[3.12] gh-77749: Fix inconsistent behavior of non-ASCII handling in EmailPolicy.fold() (GH-6986) (GH-114606)
It now always encodes non-ASCII characters in headers if utf8 is false.

(cherry picked from commit 504334c7be)

Co-authored-by: Rito Takeuchi <licht-t@outlook.jp>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-26 18:30:32 +02:00
Miss Islington (bot)
4ff2d29266
gh-114561: Mark some tests in test_wincosoleio with requires_resource('console') decorator (GH-114565)
(cherry picked from commit 33ae9895d4)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
2024-01-25 20:18:23 +00:00
Miss Islington (bot)
d2da4e417e
[3.12] gh-77465: Increase test coverage for the numbers module (GH-111738) (GH-114556)
(cherry picked from commit e721adf4bd)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-25 15:36:20 +00:00
Petr Viktorin
c912bc3ed4
[3.12] gh-114440: Close writer pipe in multiprocessing.Queue, not concurrent.futures (GH-114489)
This was left out of the 3.12 backport for three related issues:
- gh-107219 (which adds `self.call_queue._writer.close()` to `_ExecutorManagerThread` in `concurrent.futures`)
- gh-109370 (which changes this to be only called on Windows)
- gh-109047 (which moves the call to `multiprocessing.Queue`'s `_terminate_broken`)

Without this change, ProcessPoolExecutor sometimes hangs on Windows
when a worker process is terminated.

Co-authored-by: Victor Stinner <vstinner@python.org>
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-24 13:21:10 +01:00
Miss Islington (bot)
03f8f77885
[3.12] gh-113205: test_multiprocessing.test_terminate: Give tasks a chance to start (GH-114249) (GH-114516)
(cherry picked from commit ce75b4c26d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-24 07:46:27 +00:00
Miss Islington (bot)
f63dec94f6
[3.12] gh-101438: Avoid reference cycle in ElementTree.iterparse. (GH-114269) (GH-114499)
The iterator returned by ElementTree.iterparse() may hold on to a file
descriptor. The reference cycle prevented prompt clean-up of the file
descriptor if the returned iterator was not exhausted.
(cherry picked from commit ce01ab536f)

Co-authored-by: Sam Gross <colesbury@gmail.com>
2024-01-23 20:48:42 +00:00
Miss Islington (bot)
be85f35f12
[3.12] gh-108303: Move .whl test files to Lib/test/wheeldata/ (GH-114343) (#114488)
gh-108303: Move `.whl` test files to `Lib/test/wheeldata/` (GH-114343)
(cherry picked from commit ba253a4794)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-23 15:58:44 +00:00
Miss Islington (bot)
ed567c1e1f
[3.12] gh-114257: Ignore the FileNotFound error in ctypes.util._is_elf() (GH-114394) (GH-114444)
(cherry picked from commit 7fc51c3f6b)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
2024-01-22 18:10:41 +00:00
Miss Islington (bot)
4bbb9f6f29
[3.12] gh-75128: Ignore EADDRNOTAVAIL error in asyncio.BaseEventLoop.create_server() (GH-114420) (GH-114441)
(cherry picked from commit a53e56e7d8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Antoine Pitrou <pitrou@free.fr>
2024-01-22 17:15:08 +00:00
Miss Islington (bot)
4890ac136b
[3.12] gh-114275: Skip doctests that use asyncio in test_pdb for WASI builds (GH-114309) (#114439)
gh-114275: Skip doctests that use `asyncio` in `test_pdb` for WASI builds (GH-114309)
(cherry picked from commit efb81a60f5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-22 18:02:23 +01:00
Miss Islington (bot)
954bbcc1b9
[3.12] gh-108303: Remove Lib/test/shadowed_super.py (GH-114372) (#114433)
gh-108303: Remove `Lib/test/shadowed_super.py` (GH-114372)

Move code into Lib/test/test_super.py.
(cherry picked from commit 2ef520ebec)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-22 16:40:42 +01:00
Miss Islington (bot)
1bd2c93474
[3.12] gh-102512: Turn _DummyThread into _MainThread after os.fork() called from a foreign thread (GH-113261) (GH-114430)
Always set a _MainThread as a main thread after os.fork() is called from
a thread started not by the threading module.

A new _MainThread was already set as a new main thread after fork if
threading.current_thread() was not called for a foreign thread before fork.
Now, if it was called before fork, the implicitly created _DummyThread will
be turned into _MainThread after fork.

It fixes, in particularly, an incompatibility of _DummyThread with
the threading shutdown logic which relies on the main thread
having tstate_lock.

(cherry picked from commit 49785b06de)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Marek Marczykowski-Górecki <marmarek@invisiblethingslab.com>
2024-01-22 15:24:43 +00:00
Miss Islington (bot)
d1f731ff08
[3.12] gh-111803: Make test_deep_nesting from test_plistlib more strict (GH-114026) (GH-114406)
It is no longer silently passed if RecursionError was raised for low
recursion depth.
(cherry picked from commit db1c18eb62)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-22 17:16:12 +02:00
Miss Islington (bot)
58fdd15d5a
[3.12] gh-108303: Move smtpd to test.support (GH-114368) (#114427)
gh-108303: Move `smtpd` to `test.support` (GH-114368)

Update test_logging.py and test_smtplib.py.
(cherry picked from commit 8f5e7d739f)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-22 14:08:31 +00:00
Miss Islington (bot)
33c1907de2
[3.12] gh-114328: tty cbreak mode should not alter ICRNL (GH-114335) (#114410)
The terminal CR -> NL mapping setting should be inherited in cbreak mode as OSes do not specify altering it as part of their stty cbreak mode definition.
(cherry picked from commit fd49e22670)

Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-01-21 23:41:03 +00:00
Miss Islington (bot)
4c42d98154
[3.12] gh-114241: Fix and improve the ftplib CLI (GH-114242) (GH-114404)
* Fix writing the retrieved binary file to stdout.
* Add a newline after writing warnings to stderr.
* Fix a TypeError if the netrc file doesn't contain a host/default entry.
* Improve the usage message.
(cherry picked from commit 42d72b23dd)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-21 20:48:12 +00:00
Jérome Perrin
00e8c9ce9e
[3.12] gh-113358: Fix rendering tracebacks with exceptions with a broken __getattr__ (GH-113359) (#114173) 2024-01-21 17:12:17 +00:00
Peter Lazorchak
ae2a25bf60
[3.12] Check for valid tp_version_tag in specializer (gh-89811) (gh-114216) 2024-01-20 04:45:33 +08:00
Miss Islington (bot)
a76d0104d7
[3.12] gh-108303: Move all doctest related files and tests to Lib/test/test_doctest/ (GH-112109) (#114254)
gh-108303: Move all doctest related files and tests to `Lib/test/test_doctest/` (GH-112109)
(cherry picked from commit 9c93350f58)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
Co-authored-by: Brett Cannon <brett@python.org>
2024-01-18 16:25:04 +00:00
Miss Islington (bot)
6d23b32374
[3.12] gh-110345: show Tcl/Tk patchlevel in tkinter._test() (GH-110350) (GH-114253)
(cherry picked from commit b8f29b1293)

Co-authored-by: Christopher Chavez <chrischavez@gmx.us>
2024-01-18 16:11:03 +00:00
Miss Islington (bot)
c2a2126782
[3.12] gh-113205: test_multiprocessing.test_terminate: Shorter sleep for threadpools (GH-114186) (GH-114222)
Threads can't be forced to terminate (without potentially corrupting too much
state), so the  expected behaviour of `ThreadPool.terminate` is to wait for
the currently executing tasks to finish.

Use shorter sleep time for threadpools, so if a task manages to start, the test
doesn't block for long.

(cherry picked from commit c1db960608)

Co-authored-by: Petr Viktorin <encukou@gmail.com>
2024-01-18 13:49:24 +01:00
Miss Islington (bot)
eb582df61f
[3.12] gh-104522: Fix test_subprocess failure when build Python in the root home directory (GH-114236) (GH-114239)
EPERM is raised when setreuid() fails.
EACCES is set in execve() when the test user has not access to sys.executable.
(cherry picked from commit 311d1e2701)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-18 13:18:15 +01:00
Miss Islington (bot)
e7a5577b53
[3.12] gh-96905: In IDLE code, stop redefining built-ins 'dict' and 'object' (GH-114227) (#114228)
Prefix 'dict' with 'o', 'g', or 'l' for 'object', 'global', or 'local'.
Suffix 'object' with '_'.
(cherry picked from commit 6f4b242a03)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-18 05:09:26 +00:00
Miss Islington (bot)
35e330ba85
[3.12] gh-114149: [Enum] revert GH-114196 and add more tuple-subclass tests (GH-114215) (GH-114218)
gh-114149: [Enum] revert GH-114160 and add more tuple-subclass tests (GH-114215)

This reverts commit 05e142b154.
(cherry picked from commit 4c7e09d012)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-01-17 20:36:28 -08:00
Miss Islington (bot)
f8fc8534c4
[3.12] gh-104522: Fix OSError raised when run a subprocess (GH-114195) (#114219)
gh-104522: Fix OSError raised when run a subprocess (GH-114195)

Only set filename to cwd if it was caused by failed chdir(cwd).

_fork_exec() now returns "noexec:chdir" for failed chdir(cwd).

(cherry picked from commit e2c097ebde)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Co-authored-by: Robert O'Shea <PurityLake@users.noreply.github.com>
2024-01-18 01:19:11 +00:00
Tian Gao
2c9cf64a3f
[3.12] gh-112343: pdb: Use tokenize to replace convenience variables (GH-112380) (#114202) 2024-01-17 22:15:44 +00:00
Miss Islington (bot)
c1890e666e
[3.12] gh-114149: [Enum] fix tuple subclass handling when using custom __new__ (GH-114160) (GH-114196)
(cherry picked from commit 33b47a2c28)

Co-authored-by: Ethan Furman <ethan@stoneleaf.us>
2024-01-17 13:34:48 -08:00
Miss Islington (bot)
24d23929d6
[3.12] gh-38807: Fix race condition in Lib/trace.py (GH-110143) (GH-114206)
Instead of checking if a directory does not exist and thereafter
creating it, directly call os.makedirs() with the exist_ok=True.
(cherry picked from commit 78fcde039a)

Co-authored-by: buermarc <44375277+buermarc@users.noreply.github.com>
2024-01-17 20:35:00 +00:00
Serhiy Storchaka
a735fea6b1
[3.12] gh-105102: Fix nested unions in structures when the system byteorder is the opposite (GH-105106) (GH-114204)
(cherry picked from commit 0b541f64c4)

Co-authored-by: Sheidan <37596668+Sh3idan@users.noreply.github.com>
2024-01-17 20:11:44 +00:00
Miss Islington (bot)
00e7793519
[3.12] gh-104282: Fix null pointer dereference in lzma._decode_filter_properties (GH-104283) (GH-114181)
(cherry picked from commit 0154405350)

Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com>
2024-01-17 13:31:33 +00:00
Miss Islington (bot)
5af161ffe6
[3.12] gh-72284: Revise lists in IDLE doc (GH-114174) (#114175)
Tkinter is a fact, not necessarily a feature.

Reorganize editor key bindings in a logical order
and remove those that do not work, at least on Windows.

Improve shell bindings list.
(cherry picked from commit 4a32275389)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-17 03:35:19 -05:00
Miss Islington (bot)
f1f2d204d1
[3.12] gh-81479: For Help => IDLE Doc, stop double-spacing some lists. (GH-114168) (#114170)
This matches Firefox format.  Edge double-spaces non-simple
lists but I think it looks worse.
(cherry picked from commit e07a400c31)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-17 01:35:15 -05:00
Miss Islington (bot)
59da12613a
[3.12] gh-113659: Skip hidden .pth files (GH-113660) (GH-114143)
Skip .pth files with names starting with a dot or hidden file attribute.
(cherry picked from commit 74208ed0c4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-16 18:57:14 +00:00
Miss Islington (bot)
60f5f7513f
[3.12] Fix 'expresion' typo in IDLE doc (GH-114130) (#114139)
The substantive change is on line 577/593. Rest is header/footer stuff ignored when displaying.
(cherry picked from commit 7a24ecc953)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-16 18:27:43 +00:00
Miss Islington (bot)
1d5bca65e2
[3.12] gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121) (#114129)
gh-114107: test.pythoninfo logs Windows Developer Mode (GH-114121)

Also, don't skip the whole collect_windows() if ctypes is missing.

Log also ctypes.windll.shell32.IsUserAnAdmin().
(cherry picked from commit c77f552ec0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2024-01-16 16:53:29 +00:00
Miss Islington (bot)
045adb1ad8
[3.12] gh-114077: Fix OverflowError in socket.sendfile() when pass count >2GiB (GH-114079) (GH-114110)
(cherry picked from commit d4dfad2aa9)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-16 13:53:02 +02:00
Miss Islington (bot)
41a94c9e7b
[3.12] gh-109862: Fix test_create_subprocess_with_pidfd when it was run separately (GH-113991) (GH-114072)
(cherry picked from commit f8a79109d0)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-15 07:55:35 +00:00
Miss Islington (bot)
2aea0e967a
[3.12] gh-101225: Increase the socket backlog when creating a multiprocessing.connection.Listener (GH-113567) (#114018)
gh-101225: Increase the socket backlog when creating a multiprocessing.connection.Listener (GH-113567)

Increase the backlog for multiprocessing.connection.Listener` objects created
 by `multiprocessing.manager` and `multiprocessing.resource_sharer` to
 significantly reduce the risk of getting a connection refused error when creating
 a `multiprocessing.connection.Connection` to them.
(cherry picked from commit c7d59bd8cf)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-14 16:29:15 +01:00
Alois Klink
fa7d8e97c2
[3.12] gh-95649: Document that asyncio contains uvloop code (GH-107536) (#114046)
Some of the asyncio SSL changes in GH-31275 [1] were taken from
v0.16.0 of the uvloop project [2]. In order to comply with the MIT
license, we need to just need to document the copyright information.

[1]: https://github.com/python/cpython/pull/31275
[2]: https://github.com/MagicStack/uvloop/tree/v0.16.0

(cherry picked from commit dce30c9cbc)
2024-01-14 02:15:06 +00:00
Miss Islington (bot)
e08179216b
[3.12] gh-114014: Update fractions.Fraction()'s rational parsing regex (GH-114015) (#114023)
Fix a bug in the regex used for parsing a string input to the `fractions.Fraction` constructor. That bug led to an inconsistent exception message being given for some inputs.

---------

(cherry picked from commit dd56b57483)

Co-authored-by: Crowthebird <78076854+thatbirdguythatuknownot@users.noreply.github.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
Co-authored-by: Adam Turner <9087854+AA-Turner@users.noreply.github.com>
2024-01-13 13:21:34 -05:00
Miss Islington (bot)
7b7cf75c02
gh-111877: Fixes stat() handling for inaccessible files on Windows (GH-113716)
(cherry picked from commit ed066481c7)

Co-authored-by: Steve Dower <steve.dower@python.org>
2024-01-12 15:53:27 +00:00
Miss Islington (bot)
8046eb0cc8
[3.12] gh-113027: Fix test_variable_tzname in test_email (GH-113821) (GH-113831)
Determine the support of the Kyiv timezone by checking the result of
astimezone() which uses the system tz database and not the one
populated by zoneinfo.
(cherry picked from commit 931d7e052e)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-12 12:00:17 +00:00
Miss Islington (bot)
d63e4c49d3
[3.12] gh-113903: Fix an IDLE configdialog test (GH-113973) (#113974)
test_configdialog.HighPageTest.test_highlight_target_text_mouse fails
if a line of the Highlight tab text sample is not visible. If so, bbox()
in click_char() returns None and the unpacking iteration fails.

This occurred on a Devuan Linux system. Fix by moving the
'see character' call inside click_char, just before the bbox call.

Also, reduce the click_char calls to just one per tag name and
replace the other nested function with a dict comprehension.
(cherry picked from commit c4992f4106)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-12 03:39:45 +00:00
Miss Islington (bot)
b902671d36
gh-81489: Use Unicode APIs for mmap tagname on Windows (GH-14133)
(cherry picked from commit b4d4aa9e8d)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
2024-01-11 23:13:02 +00:00
Miss Islington (bot)
fa181fcf21
[3.12] gh-109858: Protect zipfile from "quoted-overlap" zipbomb (GH-110016) (GH-113912)
Raise BadZipFile when try to read an entry that overlaps with other entry or
central directory.
(cherry picked from commit 66363b9a7b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-11 11:24:29 +02:00
Miss Islington (bot)
3f607a0324
[3.12] gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (GH-113897) (#113928)
gh-113896: Fix test_builtin.BuiltinTest.test___ne__() (GH-113897)

Fix DeprecationWarning in test___ne__().

(cherry picked from commit 9d33c23857)

Co-authored-by: Kirill Podoprigora <kirill.bast9@mail.ru>
Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2024-01-10 23:56:57 +00:00
Miss Islington (bot)
4050a150e9
gh-87868: Sort and remove duplicates in getenvironment() (GH-102731)
(cherry picked from commit c31be58da8)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
Co-authored-by: Pieter Eendebak <pieter.eendebak@gmail.com>
Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
2024-01-10 23:43:39 +00:00
Miss Islington (bot)
59a7b9495b
[3.12] gh-70835: Clarify error message for CSV file opened with wrong newline (GH-113786) (GH-113905)
Based on patch by SilentGhost.
(cherry picked from commit 568d220993)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-10 13:26:04 +00:00
Miss Islington (bot)
84677ff19c
[3.12] gh-113594: Fix UnicodeEncodeError in TokenList.fold() (GH-113730) (GH-113907)
It occurred when try to re-encode an unknown-8bit part combined with non-unknown-8bit part.
(cherry picked from commit e9d5b6ea2d)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-10 13:21:50 +00:00