Commit Graph

47742 Commits

Author SHA1 Message Date
Miss Islington (bot) b9b70dd4de
gh-89610: Add .pyi as a recognised extension for IDLE on macOS (GH-95393)
This allows opening stub files by double clicking on them in the Finder.

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
(cherry picked from commit 06fc249135)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-28 16:39:02 -07:00
Serhiy Storchaka 563f0584c9
[3.10] gh-94938: Fix errror detection of unexpected keyword arguments (GH-94999) (GH-95354)
When keyword argument name is an instance of a str subclass with
overloaded methods __eq__ and __hash__, the former code could not find
the name of an extraneous keyword argument to report an error, and
_PyArg_UnpackKeywords() returned success without setting the
corresponding cell in the linearized arguments array. But since the number
of expected initialized cells is determined as the total number of passed
arguments, this lead to reading NULL as a keyword parameter value, that
caused SystemError or crash or other undesired behavior..
(cherry picked from commit ebad53a4dc)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-07-28 09:52:00 +03:00
Miss Islington (bot) fb422147d3
gh-95339: update bundled pip to 22.2.1 (gh-95340)
(cherry picked from commit 226d02bb10)

Co-authored-by: Stéphane Bidoul <stephane.bidoul@gmail.com>
2022-07-27 12:11:30 -07:00
Miss Islington (bot) b77c403ed5
gh-95280: Fix test_get_ciphers on systems without RSA key exchange (GH-95282)
(cherry picked from commit 565403038b)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-27 00:43:12 -07:00
Miss Islington (bot) f118661a18
gh-95291: Use import helper to improve sqlite3 audit tests (GH-95292)
Now the tests are correctly reported as skipped if sqlite3 is not available.
(cherry picked from commit 152eb90311)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-26 12:40:59 -07:00
Miss Islington (bot) 94eb1e9789
gh-95087: Fix IndexError in parsing invalid date in the email module (GH-95201)
Co-authored-by: wouter bolsterlee <wouter@bolsterl.ee>
(cherry picked from commit ea5ed0ba51)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-07-24 23:39:00 -07:00
Miss Islington (bot) 40f41ba5f4
gh-95212: make multiprocessing test case parallel-safe (GH-95213)
(cherry picked from commit 5956de16cd)

Co-authored-by: Christian Heimes <christian@python.org>
2022-07-24 22:11:41 -07:00
Miss Islington (bot) 6d332a6cfa
gh-95199: upgrade bundled setuptools to 63.2.0 (gh-95200)
(cherry picked from commit 3c94d3395e)

Co-authored-by: Stéphane Bidoul <stephane.bidoul@gmail.com>
2022-07-24 04:43:05 -07:00
Miss Islington (bot) 227a1973d5
gh-95194: upgrade bundled pip to 22.2 (gh-95195)
upgrade bundled pip to 22.2
(cherry picked from commit 068ffafa54)

Co-authored-by: Stéphane Bidoul <stephane.bidoul@gmail.com>
2022-07-24 03:18:33 -07:00
Miss Islington (bot) 4a682b4f1a
gh-93157: Fix fileinput didn't support `errors` in `inplace` mode (GH-95128)
(cherry picked from commit 5c7f3bcdaf)

Co-authored-by: Inada Naoki <songofacandy@gmail.com>
2022-07-23 20:02:40 -07:00
Miss Islington (bot) cbe3ad51ed
gh-94844: Add pathlib support to shutil archive management (GH-94846)
Co-authored-by: Barney Gale <barney.gale@gmail.com>
(cherry picked from commit ed4441567e)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-07-20 09:24:33 -07:00
Terry Jan Reedy 1c3b2fe0fa
[3.10] gh-90654: Update maintenance NEWS header (#94355) 2022-07-20 04:16:42 -04:00
Miss Islington (bot) 28478c7a0b
gh-90654: Add item missing from idlelib/NEWS.txt (GH-95038)
(cherry picked from commit acb105a7c1)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-07-20 00:42:36 -07:00
Miss Islington (bot) 31a390e43f
[3.10] gh-94930: skipitem() in getargs.c should return non-NULL on error (GH-94931) (GH-94963)
(cherry picked from commit 067f0da335)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-07-19 21:57:59 +03:00
Erlend Egeberg Aasland 374afb4a4e
[3.10] gh-94998: Remove incorrectly backported Lib/test/test_sqlite3 directory (#95016) 2022-07-19 20:26:38 +02:00
Miss Islington (bot) 2d79804bb0
GH-91153: Handle mutating __index__ methods in bytearray item assignment (GH-94891)
(cherry picked from commit f36589510b)

Co-authored-by: Brandt Bucher <brandtbucher@microsoft.com>
2022-07-19 10:04:47 -07:00
Shantanu 906b345ddd
[3.10] gh-94949: Disallow parsing parenthesised ctx mgr with old feature_version (GH-94950) (#94990)
(cherry picked from commit 0daba82221)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-19 07:24:48 +01:00
Miss Islington (bot) 96e15167b0
test_concurrent_futures: Fix unneeded/confusing format call (GH-93119)
Added in 339fd46cb7 - but as noted in a comment, the test only tests ThreadPoolExecutor.
(cherry picked from commit 3f2dd0a7c0)

Co-authored-by: Florian Bruhin <me@the-compiler.org>
2022-07-18 19:38:05 -07:00
Shantanu dda9198021
[3.10] gh-94947: Disallow parsing walrus with feature_version < (3, 8) (GH-94948) (#94969)
* gh-94947: Disallow parsing walrus with feature_version < (3, 8)

* oops, commit the parser

* 📜🤖 Added by blurb_it.

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>.
(cherry picked from commit ae0be5a53b)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>
2022-07-18 20:43:23 +01:00
Miss Islington (bot) 5d75edd925
gh-94821: Fix autobind of empty unix domain address (GH-94826)
When binding a unix socket to an empty address on Linux, the socket is
automatically bound to an available address in the abstract namespace.

    >>> s = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
    >>> s.bind("")
    >>> s.getsockname()
    b'\x0075499'

Since python 3.9, the socket is bound to the one address:

    >>> s.getsockname()
    b'\x00'

And trying to bind multiple sockets will fail with:

    Traceback (most recent call last):
      File "/home/nsoffer/src/cpython/Lib/test/test_socket.py", line 5553, in testAutobind
        s2.bind("")
    OSError: [Errno 98] Address already in use

Added 2 tests:
- Auto binding empty address on Linux
- Failing to bind an empty address on other platforms

Fixes f6b3a07b7d (bpo-44493: Add missing terminated NUL in sockaddr_un's length (GH-26866)
(cherry picked from commit c22f134211)

Co-authored-by: Nir Soffer <nsoffer@redhat.com>
2022-07-17 08:39:30 -07:00
Miss Islington (bot) 31608abf55
gh-94864: Fix PyArg_Parse* with deprecated format units "u" and "Z" (GH-94902)
It returned 1 (success) when warnings are turned into exceptions.
(cherry picked from commit 107c21c5d5)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-07-16 22:46:43 -07:00
Miss Islington (bot) 964431eaeb
gh-94869: Fix the location in some expressions for multi-line f-string ast nodes (GH-94895) (#94911)
(cherry picked from commit 2e9da8e352)

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-07-16 22:06:33 +01:00
Miss Islington (bot) 915fb4f441
idlelib: replace 'while 1' with 'while True' (GH-94827)
(cherry picked from commit 6a15f918b5)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-07-13 18:27:20 -07:00
Miss Islington (bot) 1bc13df628
[3.10] GH-94736: mark SemLock test as linux only (GH-94750) (#94753)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-11 17:14:57 +01:00
Miss Islington (bot) aa2142def6
bpo-45924: Fix asyncio incorrect traceback when future's exception is raised multiple times (GH-30274) (#94748)
(cherry picked from commit 86c1df1872)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-11 15:38:27 +01:00
Miss Islington (bot) 916686fdb2
GH-94736: Fix _multiprocessing.SemLock subclassing (GH-94738)
* fix allocator and deallocator

* 📜🤖 Added by blurb_it.

* code review

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
(cherry picked from commit f5b76330cf)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-11 05:39:09 -07:00
Mark Shannon b87d03d355
[3.10] GH-94329: Don't raise on excessive stack consumption (GH-94421) (#94448) 2022-07-11 13:21:17 +01:00
Erlend Egeberg Aasland dc36801f7c
[3.10] gh-94430: Allow params named `module` or `self` with custom C names in AC (GH-94431) (#94650)
(cherry picked from commit 8bbd70b4d1)

Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
2022-07-07 13:26:21 +02:00
Pablo Galindo Salgado 5e24c80b94
[3.10] gh-94510: Raise on re-entrant calls to sys.setprofile and syssettrace (GH-94511) (#94579)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>.
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
2022-07-05 19:52:33 +01:00
Łukasz Langa fd34bfe484
[3.10] gh-91330: Tests and docs for dataclass descriptor-typed fields (GH-94424) (GH-94577)
Co-authored-by: Erik De Bonte <erikd@microsoft.com>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 5f319308a8)
2022-07-05 20:45:02 +02:00
Miss Islington (bot) 922075c964
gh-90355: Add isolated flag if currently isolated (GH-92857) (GH-94569)
Co-authored-by: Carter Dodd <carter.dodd@gmail.com>
Co-authored-by: Éric <merwok@netwok.org>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit c8556bcf6c)
2022-07-05 17:58:28 +02:00
Vinay Sajip 3287e45847
[3.10] bpo-46755: Don't log stack info twice in QueueHandler (GH-31355) (GH-94565)
Co-authored-by: Erik Montnemery <erik@montnemery.com>
2022-07-05 16:04:29 +01:00
Miss Islington (bot) d793ebc11d
IDLE doc: Tweek RESTART and Windows console start (GH-94530)
(cherry picked from commit 39c29f753e)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-07-03 10:39:20 -07:00
Jason R. Coombs 259dd7ee8a
[3.10] gh-93975: Provide nicer error reporting from subprocesses in test_venv.EnsurePipTest.test_with_pip (GH-93959) (GH-94004)
This change does three things:

1. Extract a function for trapping output in subprocesses.
2. Emit both stdout and stderr when encountering an error.
3. Apply the change to `ensurepip._uninstall` check.
(cherry picked from commit 6066f450b9)

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
2022-07-01 17:34:11 +02:00
Miss Islington (bot) 47f23b2d8a
gh-84753: Make inspect.iscoroutinefunction() work with AsyncMock (GH-94050) (GH-94461)
The inspect version was not working with unittest.mock.AsyncMock.

The fix introduces special-casing of AsyncMock in
`inspect.iscoroutinefunction` equivalent to the one
performed in `asyncio.iscoroutinefunction`.

Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 4261b6bffc)

Co-authored-by: Mehdi ABAAKOUK <sileht@sileht.net>
2022-06-30 20:02:15 +02:00
Miss Islington (bot) 226fdce45d
[3.10] GH-77403: Fix tests which fail when PYTHONUSERBASE is not normalized (GH-93917) (GH-93970)
(cherry picked from commit b1ae4af5e8)


Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>

Automerge-Triggered-By: GH:iritkatriel
2022-06-30 02:48:13 -07:00
Miss Islington (bot) ee937571e7
gh-92336: linecache.getline should not raise exceptions on decoding errors (GH-94410)
(cherry picked from commit 21cbdae90f)

Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
2022-06-30 02:46:27 -07:00
Kumar Aditya 079ea44570
[3.10] GH-89988: Fix memory leak in pickle.Pickler dispatch_table lookup (GH-94298) (#94385) 2022-06-28 17:14:47 +01:00
Miss Islington (bot) eb7d354817
[3.10] gh-82006: IDLE doc improvements (GH-94349) (GH-94358)
0. Update text start and stop conditions.
1. Title-case sections but not subsections.
2. Edit Shell Window sections: title, execute, restart.
(cherry picked from commit e6391e08bf)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
2022-06-28 12:50:58 +02:00
Miss Islington (bot) 608ddd3277
gh-92841: Fix asyncio's RuntimeError: Event loop is closed (GH-92842) (GH-92904)
(cherry picked from commit 33880b4b1c)

Co-authored-by: Oleg Iarygin <oleg@arhadthedev.net>
2022-06-28 11:43:14 +02:00
Miss Islington (bot) 5e08eecb57
gh-94208: Add more TLS version/protocol checks for FreeBSD (GH-94347)
Three test cases were failing on FreeBSD with latest OpenSSL.
(cherry picked from commit 1bc86c2625)

Co-authored-by: Christian Heimes <christian@python.org>
2022-06-28 00:53:23 -07:00
wookie184 0ae7284a23
[3.10] gh-94192: Fix error for dictionary literals with invalid expression as value. (GH-94304) (#94344)
Co-authored-by: wookie184 <wookie1840@gmail.com>
2022-06-27 19:21:42 +01:00
Miss Islington (bot) da6f859e8f
[3.11] gh-84623: Remove unused imports in stdlib (GH-94313)
GH-93773

Backport only for 2 idlelib files.
Cherrypicked from  259dd71c32
(cherry picked from commit bc8d81a8fe)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-06-26 21:13:49 -07:00
Miss Islington (bot) c481cd6256
GH-94254: Make _struct module types immutable (GH-94269)
(cherry picked from commit 17ed560fcd)

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-06-26 03:45:00 -07:00
Victor Stinner 4b1144ced1
Run Tools/scripts/reindent.py (#94225) (#94291)
Reindent files which were not properly formatted (PEP 8: 4 spaces).

Remove also some trailing spaces.

(cherry picked from commit e87ada48a9)
2022-06-26 12:39:16 +02:00
Miss Islington (bot) 82f9041c0a
gh-83499: Fix closing file descriptors in tempfile (GH-93874)
(cherry picked from commit d4792ce916)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-26 01:17:19 -07:00
Miss Islington (bot) 1901d2a948
gh-94245: Test pickling and copying of typing.Tuple[()] (GH-94259) (GH-94268)
(cherry picked from commit 75cb3abc3b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-06-26 09:01:07 +03:00
Serhiy Storchaka 75dda3b12d
[3.10] gh-94245: Fix pickling and copying of typing.Tuple[()] (GH-94260) 2022-06-25 18:45:46 +03:00
Miss Islington (bot) 86e49a5026
[3.10] gh-94207: Fix struct module leak (GH-94239) (GH-94266)
* gh-94207: Fix struct module leak (GH-94239)

Make _struct.Struct a GC type

This fixes a memory leak in the _struct module, where as soon
as a Struct object is stored in the cache, there's a cycle from
the _struct module to the cache to Struct objects to the Struct
type back to the module. If _struct.Struct is not gc-tracked, that
cycle is never collected.

This PR makes _struct.Struct GC-tracked, and adds a regression test.
(cherry picked from commit 6b865349aa)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2022-06-25 16:05:06 +01:00
Miss Islington (bot) 14943829a8
IDLE: replace if statement with expression (GH-94228)
(cherry picked from commit 91f9947f23)

Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
2022-06-24 10:30:55 -07:00