Commit Graph

802 Commits

Author SHA1 Message Date
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) 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) fd247db57a
gh-93247: Fix assert function in asyncio locks test (GH-93248)
(cherry picked from commit 9081bbd036)

Co-authored-by: Cyker Way <cykerway@gmail.com>
2022-06-05 18:42:21 -07:00
Miss Islington (bot) 9e1bfd8ce7
bpo-47104: Rewrite asyncio.to_thread tests to use IsolatedAsyncioTestCase (GH-32086)
(cherry picked from commit ff619c7dfe)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-23 14:43:32 -07:00
Miss Islington (bot) 9d59381a5d
[3.10] bpo-45997: Fix asyncio.Semaphore re-acquiring order (GH-31910) (#32047)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
(cherry picked from commit 32e77154dd)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-22 17:15:24 +02:00
Miss Islington (bot) ba76f90192
bpo-47038: Increase a test timeout for slow CI machines (GH-31951)
(cherry picked from commit a7c5414832)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-16 18:20:02 -07:00
Miss Islington (bot) 36f62c5575
bpo-47038: Rewrite missed asyncio.wait_for test to use IsolatedAnsyncioTestCase (GH-31946) (#31948)
(cherry picked from commit 3dd9bfac04)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-17 02:19:51 +02:00
Miss Islington (bot) 4186dd662c
bpo-47038: Rewrite asyncio.wait_for test to use IsolatedAsyncioTestCase (GH-31942) (GH-31943)
(cherry picked from commit dd0082c627)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-03-16 22:15:08 +02:00
Miss Islington (bot) 88c243fd8d
bpo-43253: Don't call shutdown() for invalid socket handles (GH-31892)
(cherry picked from commit 70155412f1)

Co-authored-by: Maximilian Hils <git@maximilianhils.com>
2022-03-15 08:22:01 -07:00
Jelle Zijlstra 4199b7ffbb
[3.10] bpo-46198: rename duplicate tests and remove unused code (GH-30297) (GH-31796)
(cherry picked from commit 6c83c8e6b5)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-03-10 13:53:50 -08:00
Miss Islington (bot) 6717edcf84
Inherit asyncio proactor datagram transport from asyncio.DatagramTransport (GH-31512) (GH-31514)
(cherry picked from commit cff4d5c5d2)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-02-23 14:04:49 +02:00
Miss Islington (bot) d327517b54
bpo-46827: pass sock.type to getaddrinfo in sock_connect (GH-31499)
Co-authored-by: Thomas Grainger <tagrain@gmail.com>
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
(cherry picked from commit 8fb94893e4)

Co-authored-by: Thomas Grainger <tagrain@gmail.com>
2022-02-22 13:09:35 -08:00
Miss Islington (bot) f1916cde24
bpo-46672: fix `NameError` in `asyncio.gather` if type check fails (GH-31187) (GH-31440)
Co-authored-by: Alex Waygood <Alex.Waygood@Gmail.com>
(cherry picked from commit 4ab8167b9c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-02-20 17:28:42 +02:00
Andrew Svetlov 9f5145403b
[3.10] Fix warning: asyncio.events._event_loop_policy was modified by test_asyncio (GH-31253) (GH-31255)
(cherry picked from commit 012e77eb5c)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-02-10 15:27:15 +02:00
Kumar Aditya a5451c96a1
bpo-26552: Fixed case where failing `asyncio.ensure_future` did not close the coroutine (#30288) (#31003) 2022-01-28 22:57:18 -08:00
Miss Islington (bot) 75d88b91e6
bpo-41682: fixed flaky test test_sendfile_close_peer_in_the_middle_of_receiving (GH-30845) (#30860)
(cherry picked from commit 1c705fda8f)

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

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
2022-01-25 18:40:13 +01:00
Miss Islington (bot) 486b4d3d8e
bpo-41682: Skip unstable test_asyncio sendfile test on Windows (GH-30801) (GH-30812)
(cherry picked from commit 1ded8ed8e8)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-23 01:58:16 +01:00
Miss Islington (bot) 6111d5dee2
bpo-46425: fix direct invocation of `asyncio` tests (GH-30725) (#30782)
(cherry picked from commit 5a5340044c)

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>

Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
2022-01-22 14:29:51 +02:00
Miss Islington (bot) 90e2998db7
[3.10] bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777) (#30784)
* bpo-46469: Make asyncio generic classes return GenericAlias (GH-30777)

* bpo-46469: Make asyncio generic classes return GenericAlias

* 📜🤖 Added by blurb_it.

* Update Misc/NEWS.d/next/Library/2022-01-22-05-05-08.bpo-46469.plUab5.rst

Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>

Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Jelle Zijlstra <jelle.zijlstra@gmail.com>
(cherry picked from commit ea5b96842e)

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

* Fix tests

Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2022-01-22 14:28:51 +02:00
Miss Islington (bot) 95948169d7
bpo-23819: Get rid of assert statements in test_asyncio (GH-30212) (GH-30213)
To keep checks even if run tests with optimized Python.

Either use special assertion methods like assertEqual() or
raise an AssertionError explicitly.
(cherry picked from commit 6ca78affc8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-12-20 14:50:45 +02:00
Andrew Svetlov cdb4579607
[3.10] bpo-46129: Rewrite asyncio.locks tests with IsolatedAsyncioTestCase (GH-30198) (GH-30202)
Co-authored-by: Kumar Aditya <59607654+kumaraditya303@users.noreply.github.com>.
(cherry picked from commit 9c06fd8951)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2021-12-19 17:17:40 +02:00
Miss Islington (bot) 305236e03a
bpo-37658: Actually return result in race condition (GH-29202)
(cherry picked from commit 934a826237)

Co-authored-by: Sam Bull <aa6bs0@sambull.org>
2021-11-29 00:37:34 -08:00
Miss Islington (bot) 164dddf5f8
bpo-45416: Fix use of asyncio.Condition() with explicit Lock objects (GH-28850)
Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
(cherry picked from commit 1a7892414e)

Co-authored-by: Joongi Kim <joongi@lablup.com>
2021-10-10 09:25:14 -07:00
Christian Clauss cfca4a6774
[3.10] Fix typos in the Lib directory (GH-28775) (GH-28804)
Fix typos in the Lib directory as identified by codespell.

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

Co-authored-by: Christian Clauss <cclauss@me.com>
2021-10-07 11:49:47 -04:00
Serhiy Storchaka 462c1f0403
[3.10] bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005) (GH-28027)
(cherry picked from commit 2a8127cafe)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-09-08 17:08:57 +02:00
Miss Islington (bot) 9f814beadb
bpo-45011: Fix test_asyncio without C module _asyncio (GH-27968)
Co-authored-by: Łukasz Langa <lukasz@langa.pl>
(cherry picked from commit 7dc505b865)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-26 06:41:29 -07:00
Miss Islington (bot) 88a1920c7b
bpo-44968: Fix test_subprocess_wait_no_same_group in test_asyncio (GH-27870)
The code of the test was never executed because the test function
was unintentionally converted to a generator function.
(cherry picked from commit 585390fdd8)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2021-08-21 13:30:08 -07:00
Miss Islington (bot) c032a12cbb
bpo-44287: asyncio test_popen() uses longer timeout (GH-26832)
Fix asyncio test_popen() of test_windows_utils by using a longer
timeout. Use military grade battle-tested test.support.SHORT_TIMEOUT
timeout rather than a hardcoded timeout of 10 seconds: it's 30
seconds by default, but it is made longer on slow buildbots.

WaitForMultipleObjects() timeout argument is in milliseconds.
(cherry picked from commit be1cb3214d)

Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-21 17:22:02 -07:00
Miss Islington (bot) 0d441d2e70
bpo-38323: Skip SubprocessMultiLoopWatcherTest as they can hang the test suite (GH-26542) (GH-26544)
(cherry picked from commit f171877ebe)

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

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-05 01:05:54 +01:00
Pablo Galindo 7719953b30
bpo-44011: Revert "New asyncio ssl implementation (GH-17975)" (GH-25848)
This reverts commit 5fb06edbbb and all
subsequent dependent commits.
2021-05-03 16:21:59 +01:00
Andrew Svetlov 4ffd6fd2f1
Increase test timeout (GH-25842) 2021-05-03 12:06:17 +03:00
Christian Heimes 37ebdf0a86
bpo-44011: Fix asyncio tests without ssl module (GH-25840)
Signed-off-by: Christian Heimes <christian@python.org>
2021-05-03 09:38:56 +02:00
Andrew Svetlov 5fb06edbbb
bpo-44011: New asyncio ssl implementation (#17975) 2021-05-03 00:34:15 +03:00
Serhiy Storchaka 172c0f2752
bpo-39529: Deprecate creating new event loop in asyncio.get_event_loop() (GH-23554)
asyncio.get_event_loop() emits now a deprecation warning when it creates a new event loop.
In future releases it will became an alias of asyncio.get_running_loop().
2021-04-25 13:40:44 +03:00
Christian Heimes 2875c603b2
bpo-43880: Show DeprecationWarnings for deprecated ssl module features (GH-25455)
* ssl.OP_NO_SSLv2
* ssl.OP_NO_SSLv3
* ssl.OP_NO_TLSv1
* ssl.OP_NO_TLSv1_1
* ssl.OP_NO_TLSv1_2
* ssl.OP_NO_TLSv1_3
* ssl.PROTOCOL_SSLv2
* ssl.PROTOCOL_SSLv3
* ssl.PROTOCOL_SSLv23 (alias for PROTOCOL_TLS)
* ssl.PROTOCOL_TLS
* ssl.PROTOCOL_TLSv1
* ssl.PROTOCOL_TLSv1_1
* ssl.PROTOCOL_TLSv1_2
* ssl.TLSVersion.SSLv3
* ssl.TLSVersion.TLSv1
* ssl.TLSVersion.TLSv1_1
* ssl.wrap_socket()
* ssl.RAND_pseudo_bytes()
* ssl.RAND_egd() (already removed since it's not supported by OpenSSL 1.1.1)
* ssl.SSLContext() without a protocol argument
* ssl.match_hostname()
* hashlib.pbkdf2_hmac() (pure Python implementation, fast OpenSSL
  function will stay)

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-19 07:27:10 +02:00
Christian Heimes b467d9a240
bpo-43522: Fix SSLContext.hostname_checks_common_name (GH-24899)
Fix problem with ssl.SSLContext.hostname_checks_common_name. OpenSSL does not
copy hostflags from *struct SSL_CTX* to *struct SSL*.

Signed-off-by: Christian Heimes <christian@python.org>
2021-04-17 10:07:19 +02:00
Christian Heimes 95bbb331ec
bpo-43723: Fix deprecation error caused by thread.setDaemon() (GH-25361) 2021-04-12 13:12:36 +02:00
Inada Naoki 35715d1e72
bpo-43651: PEP 597: Fix EncodingWarning in some tests (GH-25145)
* test_asyncio
* test_bz2
* test_math
* test_cmath
* test_cmd_line
* test_cmd_line_script
* test_compile
* test_contextlib
* test_profile
* ctypes/test/test_find
* test_multiprocessing
* test_configparser
* test_csv
* test_dbm_dumb
* test_decimal
* test_difflib
* os.fdopen() calls io.text_encoding() to emit EncodingWarning for right place.
2021-04-04 09:01:23 +09:00
Richard Kojedzinszky 17ef4319a3
bpo-41891: ensure asyncio.wait_for waits for task completion (#22461) 2020-12-18 09:26:04 -08:00
pxinwr ba760f3710
bpo-31904: Skip some asyncio tests on VxWorks (#23815) 2020-12-17 12:04:47 +02:00
Victor Stinner 99d28c5670
bpo-40364: asyncio uses os.waitstatus_to_exitcode() (GH-23798)
test_unix_events.py no longer checks if waitstatus_to_exitcode() mock
has been called or not to make the test more functional, rather than
checking the exact implementation.
2020-12-16 12:11:24 +01:00
Victor Stinner 7e5e13d113
bpo-42553: Fix test_asyncio.test_call_later() (GH-23627)
Fix test_asyncio.test_call_later() race condition: don't measure
asyncio performance in the call_later() unit test. The test failed
randomly on the CI.
2020-12-03 13:56:41 +01:00
Zackery Spytz 8085f742f4
bpo-34215: Clarify IncompleteReadError message when "expected" is None (GH-21925)
Co-Authored-By: Tyler Bell <mrbell321@gmail.com>
2020-11-28 16:27:28 +02:00
Yurii Karabas e4fe303b8c
bpo-42392: Remove loop parameter from asyncio.tasks and asyncio.subprocess (GH-23521) 2020-11-28 10:21:17 +02:00
Yurii Karabas f533cb80cb
bpo-42392: Remove loop parameter from asyncio.streams (GH-23517) 2020-11-26 09:36:37 +02:00
Yurii Karabas b9127dd6ee
bpo-42392: Improve removal of *loop* parameter in asyncio primitives (GH-23499)
* Update code after merge review from 1st1

* Use a sentinel approach for loop parameter
Remove unnecessary _get_running_loop patching

* Use more clear function name (_verify_parameter_is_marker -> _verify_no_loop)

* Add init method to _LoopBoundMixin to check that loop param wasn't used
2020-11-25 06:50:44 -05:00
Yurii Karabas 0ec34cab9d
bpo-42392: Remove loop parameter form asyncio locks and Queue (#23420)
Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2020-11-24 20:08:54 +02:00
Christian Heimes 03c8ddd9e9
bpo-42413: socket.timeout is now an alias of TimeoutError (GH-23413)
Signed-off-by: Christian Heimes <christian@python.org>
2020-11-20 00:26:07 -08:00
Diogo Dutra 7e5ef0a571
bpo-42140: Improve asyncio.wait function (GH-22938)
# Improve asyncio.wait function

The original code creates the futures set two times.
We can create this set before, avoiding the second creation.

This new behaviour [breaks the aiokafka library](https://github.com/aio-libs/aiokafka/pull/672), because it gives an iterator to that function, so the second iteration become empty.

Automerge-Triggered-By: GH:1st1
2020-11-10 14:12:52 -08:00
Andrew Svetlov 42d873c63a
bpo-42183: Fix a stack overflow error for asyncio Task or Future repr() (GH-23020)
The overflow occurs under some circumstances when a task or future
recursively returns itself.

Co-authored-by: Kyle Stanley <aeros167@gmail.com>
2020-11-10 15:58:31 +02:00