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>
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>
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>
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>
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>
It returned 1 (success) when warnings are turned into exceptions.
(cherry picked from commit 107c21c5d5)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 2e9da8e352)
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
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>
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>
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>
Three test cases were failing on FreeBSD with latest OpenSSL.
(cherry picked from commit 1bc86c2625)
Co-authored-by: Christian Heimes <christian@python.org>
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>
* 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>