Commit Graph

103 Commits

Author SHA1 Message Date
Andrew Svetlov 7c684073f9
bpo-32622: Implement loop.sendfile() (#5271) 2018-01-27 21:22:47 +02:00
Victor Stinner 789e359f51 bpo-32636: Fix two bugs in test_asyncio (#5302) 2018-01-24 15:15:14 -05:00
Yury Selivanov f23746a934
bpo-32436: Implement PEP 567 (#5027) 2018-01-22 19:11:18 -05:00
Andrew Svetlov 7464e87a65
bpo-32410: Make SendfileNotAvailableError exception public (#5243) 2018-01-19 20:04:29 +02:00
Andrew Svetlov 6b5a27975a
bpo-32410: Implement loop.sock_sendfile() (#4976) 2018-01-16 19:59:34 +02:00
Andrew Svetlov 51eb1c6b9c
bpo-29970: Make ssh_handshake_timeout None by default (#4939)
* Make ssh_handshake_timeout None by default.
* Raise ValueError if ssl_handshake_timeout is used without ssl.
* Raise ValueError if ssl_handshake_timeout is not positive.
2017-12-20 20:24:43 +02:00
Neil Aspinall f7686c1f55 bpo-29970: Add timeout for SSL handshake in asyncio
10 seconds by default.
2017-12-19 21:45:42 +02:00
Yury Selivanov e796b2fe26
bpo-27456: Ensure TCP_NODELAY is set on linux (#4231) 2017-12-15 19:32:25 -05:00
Yury Selivanov 19a44f63c7
bpo-32327: Convert asyncio functions documented as coroutines to coroutines. (#4872) 2017-12-14 20:53:26 -05:00
Victor Stinner 721e25c653
bpo-32101: Fix tests for PYTHONDEVMODE=1 (#4821)
test_asycio: remove also aio_path which was used when asyncio was
developed outside the stdlib.
2017-12-12 23:15:00 +01:00
Yury Selivanov 3e9751819a
bpo-32273: Move asyncio.test_utils to test.test_asyncio (#4785) 2017-12-11 10:04:40 -05:00
Andrew Svetlov 5f841b5538
bpo-32193: Convert asyncio to async/await usage (#4753)
* Convert asyncio/tasks.py to async/await

* Convert asyncio/queues.py to async/await

* Convert asyncio/test_utils.py to async/await

* Convert asyncio/base_subprocess.py to async/await

* Convert asyncio/subprocess.py to async/await

* Convert asyncio/streams.py to async/await

* Fix comments

* Convert asyncio/locks.py to async/await

* Convert asyncio.sleep to async def

* Add a comment

* Add missing news

* Convert stubs from AbstrctEventLoop to async functions

* Convert subprocess_shell/subprocess_exec

* Convert connect_read_pipe/connect_write_pip to async/await syntax

* Convert create_datagram_endpoint

* Convert create_unix_server/create_unix_connection

* Get rid of old style coroutines in unix_events.py

* Convert selector_events.py to async/await

* Convert wait_closed and create_connection

* Drop redundant line

* Convert base_events.py

* Code cleanup

* Drop redundant comments

* Fix indentation

* Add explicit tests for compatibility between old and new coroutines

* Convert windows event loop to use async/await

* Fix double awaiting of async function

* Convert asyncio/locks.py

* Improve docstring

* Convert tests to async/await

* Convert more tests

* Convert more tests

* Convert more tests

* Convert tests

* Improve test
2017-12-09 00:23:48 +02:00
Victor Stinner 44862df2ee
bpo-32047: -X dev enables asyncio debug mode (#4418)
The new -X dev command line option now also enables asyncio debug
mode.
2017-11-20 07:14:07 -08:00
Yury Selivanov 4652bf2acc
Rewrite asyncio test to be more meaningful (#4363) 2017-11-10 15:34:17 -05:00
jimmylai d1e34031f6 [asyncio] bpo-30423: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed." (#3295)
* call remove_done_callback in finally section

* [asyncio] bpo-30423 bug: add regression test for orphan future causes "RuntimeError: Event loop stopped before Future completed."
2017-11-01 15:54:45 +02:00
Quentin Dawans fe4ea9cf1e bpo-31245: Asyncio unix socket datagram (#3164) 2017-10-30 09:43:02 -04:00
Yury Selivanov dab0584738 Issue #28652: Partially rollback previous changes
Allow AF_UNIX in create_server & create_connection
2016-11-21 17:47:27 -05:00
Yury Selivanov a1a8b7d3d7 Issue #28652: Make loop methods reject socket kinds they do not support. 2016-11-09 15:47:00 -05:00
Yury Selivanov 600a349781 Issue #28613: Fix get_event_loop() to return the current loop
when called from coroutines or callbacks.
2016-11-04 14:29:28 -04:00
Yury Selivanov 491a912659 Issue #28600: Optimize loop.call_soon().
Run expensive type checks only in debug mode.  In addition, stop
supporting passing handles to loop.run_in_executor.
2016-11-03 15:09:24 -07:00
Yury Selivanov 0de3de6cbf Issue #28371: Deprecate passing asyncio.Handles to run_in_executor. 2016-10-05 18:28:09 -04:00
Yury Selivanov 5b8d4f97f8 Issue #28369: Raise an error when transport's FD is used with add_reader 2016-10-05 17:48:59 -04:00
Guido van Rossum e3c65a7a22 Misc asyncio improvements from upstream 2016-09-30 08:17:15 -07:00
Yury Selivanov 5587d7c071 Issue #28174: Handle when SO_REUSEPORT isn't properly supported (asyncio)
Patch by Seth Michael Larson.
2016-09-15 15:45:07 -04:00
Yury Selivanov a1b0e7db73 Issue #27906: Fix socket accept exhaustion during high TCP traffic.
Patch by Kevin Conway.
2016-09-15 14:13:15 -04:00
Martin Panter 5fc7c4dce1 Issue #27136: Change test to use ::1 for better OS X Tiger compatibility 2016-06-13 03:17:47 +00:00
Yury Selivanov f1c6fa9866 Issue #27136: Fix DNS static resolution; don't use it in getaddrinfo
Patch by A. Jesse Jiryu Davis
2016-06-08 12:33:31 -04:00
Yury Selivanov a714616d36 asyncio: Fix getaddrinfo to accept service names (for port)
Patch by A. Jesse Jiryu Davis
2016-06-02 16:51:07 -04:00
Yury Selivanov a8f895f051 asyncio: Support host=b'' for getaddrinfo 2016-06-02 16:43:52 -04:00
Yury Selivanov eaaaee8c56 asyncio: Fix getaddrinfo to accept None/str/bytes for 'port' arg
Patch by A. Jesse Jiryu Davis.
2016-05-20 17:44:19 -04:00
Yury Selivanov 7ed7ce6ee7 Issue #27040: Add loop.get_exception_handler method 2016-05-16 15:20:38 -04:00
Yury Selivanov f11352c114 asyncio/tests: Ensure a gc_collect for __del__ testing
Patch by Philip Jenvey
2016-05-13 16:10:43 -04:00
Yury Selivanov 3cd863c86e asyncio/tests: Fix ResourceWarnings related to unclosed transports 2015-12-16 20:23:26 -05:00
Yury Selivanov 5f68ca66bf asyncio/tests: Fix some ResourceWarnings 2015-12-16 19:51:09 -05:00
Yury Selivanov ec45226eeb Normalize whitespace 2015-12-16 19:35:30 -05:00
Yury Selivanov d5c2a62100 asyncio: Skip getaddrinfo if host is already resolved.
getaddrinfo takes an exclusive lock on some platforms, causing clients to queue
up waiting for the lock if many names are being resolved concurrently. Users
may want to handle name resolution in their own code, for the sake of caching,
using an alternate resolver, or to measure DNS duration separately from
connection duration. Skip getaddrinfo if the "host" passed into
create_connection is already resolved.

See https://github.com/python/asyncio/pull/302 for details.

Patch by A. Jesse Jiryu Davis.
2015-12-16 19:31:17 -05:00
Yury Selivanov 0f3c9765d4 asyncio: Fix with github
See https://github.com/python/asyncio/pull/295 for details
2015-11-20 12:57:34 -05:00
Yury Selivanov a211a7a0e7 asyncio.tests: Fix whitespace 2015-11-20 12:43:52 -05:00
Yury Selivanov b485bb416c asyncio: Sync with github 2015-11-20 12:39:43 -05:00
Guido van Rossum 41f69f4cc7 Issue #25593: Change semantics of EventLoop.stop(). 2015-11-19 13:28:47 -08:00
Guido van Rossum 36bbd0f239 Issue #23972: Fix tests for Windows and Debian. 2015-10-06 08:24:10 -07:00
Guido van Rossum b9bf913ab3 Issue #23972: updates to asyncio datagram API. By Chris Laws. 2015-10-05 09:15:28 -07:00
Yury Selivanov 1af2bf75a2 asyncio: Support PEP 492. Issue #24017. 2015-05-11 22:27:25 -04:00
Yury Selivanov 59eb9a4da5 asyncio: async() function is deprecated in favour of ensure_future(). 2015-05-11 14:48:38 -04:00
Yury Selivanov 740169cd24 Sync asyncio changes from the main repo. 2015-05-11 14:23:38 -04:00
Victor Stinner 33cb0396e8 Issue #23243: Close explicitly event loops in asyncio tests 2015-01-15 13:17:34 +01:00
Victor Stinner 29ad0111bd asyncio: sync with Tulip
* PipeHandle now uses None instead of -1 for a closed handle
* Sort imports in windows_utils.
* Fix test_events on Python older than 3.5. Skip SSL tests on the
  ProactorEventLoop if ssl.MemoryIO is missing
* Fix BaseEventLoop._create_connection_transport(). Close the transport if the
  creation of the transport (if the waiter) gets an exception.
* _ProactorBasePipeTransport now sets _sock to None when the transport is
  closed.
* Fix BaseSubprocessTransport.close(). Ignore pipes for which the protocol is
  not set yet (still equal to None).
* TestLoop.close() now calls the close() method of the parent class
  (BaseEventLoop).
* Cleanup BaseSelectorEventLoop: create the protocol on a separated line for
  readability and ease debugging.
* Fix BaseSubprocessTransport._kill_wait(). Set the _returncode attribute, so
  close() doesn't try to terminate the process.
* Tests: explicitly close event loops and transports
* UNIX pipe transports: add closed/closing in repr(). Add "closed" or "closing"
  state in the __repr__() method of _UnixReadPipeTransport and
  _UnixWritePipeTransport classes.
2015-01-15 00:04:21 +01:00
Victor Stinner 15cc678d89 asyncio: Truncate to 80 columns 2015-01-09 00:09:10 +01:00
Victor Stinner 956de691f8 Issue #22926: In debug mode, call_soon(), call_at() and call_later() methods of
asyncio.BaseEventLoop now use the identifier of the current thread to ensure
that they are called from the thread running the event loop.

Before, the get_event_loop() method was used to check the thread, and no
exception was raised when the thread had no event loop. Now the methods always
raise an exception in debug mode when called from the wrong thread. It should
help to notice misusage of the API.
2014-12-26 21:07:52 +01:00
Victor Stinner d7ff5a5375 asyncio: sync with Tulip
* Fix pyflakes warnings: remove unused imports and variables
* asyncio.test_support now uses test.support and test.script_helper if available
2014-12-26 21:16:42 +01:00