Commit graph

50922 commits

Author SHA1 Message Date
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
Miss Islington (bot)
7530c612d1
[3.12] gh-113877: Fix Tkinter method winfo_pathname() on 64-bit Windows (GH-113900) (GH-113901)
winfo_id() converts the result of "winfo id" command to integer, but
"winfo pathname" command requires an argument to be a hexadecimal number
on Win64.
(cherry picked from commit 1b7e0024a1)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-10 10:53:27 +00:00
Miss Islington (bot)
159e3db1f7
[3.12] GH-113661: unittest runner: Don't exit 5 if tests were skipped (GH-113856) (#113875)
GH-113661: unittest runner: Don't exit 5 if tests were skipped (GH-113856)

The intention of exiting 5 was to detect issues where the test suite
wasn't discovered at all. If we skipped tests, it was correctly
discovered.
(cherry picked from commit 3a9096c337)

Co-authored-by: Stefano Rivera <stefano@rivera.za.net>
2024-01-09 13:34:38 -08:00
Miss Islington (bot)
85cf360d29
[3.12] gh-113781: Silence AttributeError in warning module during Python finalization (GH-113813) (GH-113873)
The tracemalloc module can already be cleared.
(cherry picked from commit 0297418cac)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-09 22:40:30 +02:00
Miss Islington (bot)
cdd703d131
[3.12] gh-113692: skip a test if multiprocessing isn't available. (GH-113704) (GH-113844)
(cherry picked from commit 842b738129)
2024-01-09 08:13:41 +00:00
Miss Islington (bot)
7390dffce0
[3.12] gh-74678: Increase base64 test coverage (GH-21913) (GH-113811)
Ensure the character y is disallowed within an Ascii85 5-tuple.

(cherry picked from commit 802d4954f1)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
Co-authored-by: Lee Cannon <leecannon@leecannon.xyz>
2024-01-08 11:20:36 +00:00
Miss Islington (bot)
ad2d5ec97e
[3.12] gh-80109: Fix io.TextIOWrapper dropping the internal buffer during write() (GH-22535) (GH-113808)
io.TextIOWrapper was dropping the internal decoding buffer
during read() and write() calls.
(cherry picked from commit 73c9326563)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2024-01-08 11:00:30 +00:00
Miss Islington (bot)
db6f297d44
[3.12] gh-112795: Allow / folder in a zipfile (GH-112932) (#113789)
gh-112795: Allow `/` folder in a zipfile (GH-112932)

Allow extraction (no-op) of a "/" folder in a zipfile, they are commonly added by some archive creation tools.

(cherry picked from commit 541c5dbb81)

Co-authored-by: AN Long <aisk@users.noreply.github.com>
Co-authored-by: Erlend E. Aasland <erlend@python.org>
Co-authored-by: Gregory P. Smith <greg@krypto.org>
2024-01-07 01:45:37 +00:00
Miss Islington (bot)
4d5328cbeb
[3.12] gh-113729: Fix IDLE's Help -> "IDLE Help" menu bug in 3.12.1 and 3.11.7 (GH-113731) (#113765)
(cherry picked from commit 66f3964815)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2024-01-06 06:53:34 +00:00
Serhiy Storchaka
6d9af66616
[3.12] gh-62260: Fix ctypes.Structure subclassing with multiple layers (GH-13374) (GH-113623)
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-05 22:52:41 +00:00
Miss Islington (bot)
e132751b49
[3.12] gh-85567: Fix resouce warnings in pickle and pickletools CLIs (GH-113618) (GH-113758)
Explicitly open and close files instead of using FileType.
(cherry picked from commit bd754b93ca)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2024-01-05 22:37:43 +00:00
Diego Russo
b95cebf2b6
[3.12] gh-110190: Fix ctypes structs with array on PPCLE64 (GH-112959) (#113170)
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: I31730a3ebe558570ce1d7a3b26db8392f18d1770
2024-01-05 16:45:26 +01:00
Pablo Galindo Salgado
0affc3d0f0
[3.12] gh-113703: Correctly identify incomplete f-strings in the codeop module (GH-113709) (#113733)
(cherry picked from commit 3003fbbf00)
2024-01-05 13:23:40 +00:00
Alex Waygood
8435fbfe4e
[3.12] gh-113320: Reduce the number of dangerous getattr() calls when constructing protocol classes (#113401) (#113722)
- Only attempt to figure out whether protocol members are "method members" or not if the class is marked as a runtime protocol. This information is irrelevant for non-runtime protocols; we can safely skip the risky introspection for them.
- Only do the risky getattr() calls in one place (the runtime_checkable class decorator), rather than in three places (_ProtocolMeta.__init__, _ProtocolMeta.__instancecheck__ and _ProtocolMeta.__subclasscheck__). This reduces the number of locations in typing.py where the risky introspection could go wrong.
- For runtime protocols, if determining whether a protocol member is callable or not fails, give a better error message. I think it's reasonable for us to reject runtime protocols that have members which raise strange exceptions when you try to access them. PEP-544 clearly states that all protocol member must be callable for issubclass() calls against the protocol to be valid -- and if a member raises when we try to access it, there's no way for us to figure out whether it's a callable member or not!

(cherry-picked from commit ed6ea3ea79)
2024-01-05 01:51:17 +00:00
Miss Islington (bot)
92ba4e10fa
[3.12] gh-113538: Don't error in stream reader protocol callback when task is cancelled (GH-113690) (#113713)
(cherry picked from commit 4681a5271a)

Co-authored-by: Guido van Rossum <guido@python.org>
2024-01-04 20:51:53 +00:00
Miss Islington (bot)
329f8d1f0b
[3.12] gh-113628: Fix test_site test with long stdlib paths (GH-113640) (#113671)
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-02 17:59:39 -07:00
Miss Islington (bot)
499f1d0a03
[3.12] gh-113602: Bail out when the parser tries to override existing errors (GH-113607) (#113652)
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:27:20 +00:00
Miss Islington (bot)
c0de843c12
[3.12] gh-113543: Make sure that MacOSXOSAScript sends webbrowser.open audit event (GH-113544) (#113549)
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:56:18 +01:00
Miss Islington (bot)
c1b396cdf3
[3.12] gh-57795: Add news to idlelib/News3.txt (GH-113522) (#113523)
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:05:59 +00:00