Commit graph

27750 commits

Author SHA1 Message Date
Kristján Valur Jónsson
d23ab79952
[3.10] GH--93592: Fix frame chain when throwing exceptions into coroutines (GH-95207) 2022-08-23 12:23:39 +01:00
Shantanu
9fbc81760e
[3.10] gh-94996: Disallow lambda pos only params with feature_version < (3, 8) (GH-95934) (GH-95938)
(cherry picked from commit a965db37f2)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>

Automerge-Triggered-By: GH:lysnikolaou
2022-08-12 12:47:07 -07:00
Shantanu
a92c2d6eb5
[3.10] gh-94996: Disallow parsing pos only params with feature_version < (3, 8) (GH-95935)
(cherry picked from commit b5e3ea2862)

Co-authored-by: Shantanu <12621235+hauntsaninja@users.noreply.github.com>

Automerge-Triggered-By: GH:lysnikolaou
2022-08-12 12:03:44 -07:00
Miss Islington (bot)
b11895e3e7
gh-95349: Hide a Distutils Warning Filter for test_check_c_globals (GH-95837)
Under certain build conditions, test_check_c_globals fails.  This fix takes the same approach as we took for gh-84236 (via gh-20095).  We'll be removing use of distutils in the c-analyzer at some point.  Until then we'll hide the warning filter.
(cherry picked from commit 3ff6d9affb)

Co-authored-by: Eric Snow <ericsnowcurrently@gmail.com>
2022-08-10 17:15:53 -07:00
Miss Islington (bot)
b4f968e094
gh-95605: Fix float(s) error message when s contains only whitespace (GH-95665) (GH-95859)
This PR fixes the error message from float(s) in the case where s contains only whitespace.
(cherry picked from commit 97e9cfa75a)

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2022-08-10 19:57:55 +01:00
Serhiy Storchaka
da4aae29f8
[3.10] gh-91838: Resolve more HTTP links which redirect to HTTPS (GH-95650). (GH-95786)
(cherry picked from commit cc9160a29b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-08-08 18:09:06 +03:00
Miss Islington (bot)
f05a0f48e8
gh-95376: Add test for names containing null (GH-GH-5394) (GH-95747)
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@protonmail.com>
(cherry picked from commit a17cd47b61)

Co-authored-by: Sion Kang <31057849+Yaminyam@users.noreply.github.com>
2022-08-06 19:32:27 +02:00
Miss Islington (bot)
9278fc4e27
gh-95395: Add argument type error test (GH-95412) (GH-95745)
(cherry picked from commit 4703c15811)

Co-authored-by: Sion Kang <31057849+Yaminyam@users.noreply.github.com>
2022-08-06 19:30:29 +02:00
Miss Islington (bot)
9a23f582ee
Fix typo in test_dataclasses.py (gh-95735)
`dataclass` was called as a function when it was almost certainly intended to be a decorator.
(cherry picked from commit 59e09efe88)

Co-authored-by: da-woods <dw-git@d-woods.co.uk>
2022-08-06 09:16:01 -07:00
Miss Islington (bot)
be30a6dc4d
gh-91838: Resolve HTTP links which redirect to HTTPS (GH-95642)
It updates links which redirect to HTTPS with different authority or
path.
(cherry picked from commit d0d0154443)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-08-04 06:15:01 -07:00
Miss Islington (bot)
f6c46b4852
gh-95597: Fix typo in Lib directory files (GH-95599)
(cherry picked from commit b53aed76d2)

Co-authored-by: Jo, Yunjin <black33jo@gmail.com>
2022-08-03 14:50:10 -07:00
Miss Islington (bot)
0579a187df
gh-94938: Fix test (GH-95396)
(cherry picked from commit 0956b6d9c4)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2022-07-29 23:38:28 -07:00
Łukasz Langa
18418858b2
[3.10] gh-95166: cancel map waited on future on timeout (GH-95169) (GH-95375)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-07-29 14:36:58 +02: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)
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)
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)
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)
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
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
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)
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)
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
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
Steve Dower
8d8ce130fd
gh-94205: Ensures all required DLLs are copied on Windows for underpth tests (GH-94206) 2022-06-24 12:39:22 +01:00
Pablo Galindo Salgado
05cae26572
[3.10] gh-92858: Improve error message for some suites with syntax error before ':' (GH-92894). (#94183)
(cherry picked from commit 2fc83ac3af)

Co-authored-by: wookie184 <wookie1840@gmail.com>

Co-authored-by: wookie184 <wookie1840@gmail.com>
2022-06-23 18:37:53 +01:00