Commit Graph

849 Commits

Author SHA1 Message Date
Fantix King 506a2aa1eb apply bpo-37228
* refs python/cpython#17311
2020-05-13 13:52:17 -05:00
Fantix King 9e017e6ee9 Accept empty addr in UDP on_receive
* Fixes #304
2020-04-27 21:46:03 -05:00
Fantix King d51ce36785 Add name keyword argument to loop.create_task()
* Fixes #309.
* Refs bpo-34270.
2020-04-16 12:47:51 -05:00
Fantix King d99d7dcf46 skip for bpo-27500 2020-04-10 20:55:27 -05:00
Fantix King 1d9267afa8 Allow sendto the same addr if remote_addr is set
* Fixes #319.
2020-04-10 20:55:27 -05:00
Jeremy Lainé e8eb50269f Add .flake8 to distribution tarball (fixes: #330) 2020-04-09 08:29:24 +02:00
jack1142 2870219558
Stop using `loop` kwarg in `asyncio.wait()` call (DeprecationWarning) (#327) 2020-03-30 17:37:38 -07:00
Andrew Svetlov 9bc4a204ca Wakeup the waiter with exception if handshake fails 2020-03-24 13:11:31 -05:00
Fantix King f17ab4329e
fix Travis macOS build (#325) 2020-03-24 10:05:36 -05:00
YoSTEALTH 5dc299b788 updated cython version check 2020-02-19 23:36:00 -08:00
Yury Selivanov 35f82506d1
Bump the version to 0.15.0.dev0 2019-10-28 23:27:22 -04:00
Fantix King 8beacd2656 run `test_shutdown_timeout_handler_not_set` in aio 2019-10-28 22:53:47 -04:00
Yury Selivanov c32c7039cd Fix KeyboardInterrupt handling logic.
When uvloop is run in the main thread we *always* want to set up a
self-pipe and a signal wakeup FD.  That's the only way how libuv
can be notified that a ^C happened and break away from selecting
on sockets.

asyncio does not need to do that, as the 'selectors' module it uses
is already aware of the way Python implements ^C handling.

This translates to a slightly different behavior between asyncio &
uvloop:

1. uvloop needs to always call signal.set_wakeup_fd() when run in the
  main thread;

2. asyncio only needs to call signal.set_wakeup_fd() when a user
  registers a signal handler.

(2) means that if the user had not set up any signals, the signal
wakeup FD stays the same between different asyncio runs.  This commit
fixes uvloop signal implementation to make sure that uvloop behaves
the same way as asyncio in regards to signal wakeup FD between the
loop runs.  It also ensures that uvloop always have a proper
self-pipe set up so that ^C is always supported when it is run in
the main thread.

Issue #295.
2019-10-28 22:53:26 -04:00
Fantix King 6476aad6fd fix missing data on EOF in flushing
* when EOF is received and data is still pending in incoming buffer,
  the data will be lost before this fix
* also removed sleep from a recent-written test
2019-10-28 18:14:43 -04:00
Yury Selivanov 695a520195
Fix wheels upload 2019-10-25 17:03:54 -04:00
Elvis Pranskevichus ef7040d1a2
Fix manylinux for 3.8
3.8 has dropped the 'm' ABI suffix.
2019-10-25 12:03:30 -04:00
Fantix King 7fcbfed1ef fix None _shutdown_timeout_handle issue
* Fixes #255
* Also make handles more robust
2019-10-25 10:22:31 -04:00
Yury Selivanov b2aa8dbbaa
Fix a compiler warning in process.pyx 2019-10-25 00:10:59 -04:00
Yury Selivanov 006805091c
Drop explicit `loop=` argument from test_wakeup_fd_unchanged 2019-10-25 00:10:59 -04:00
Yury Selivanov 3e6a0430f6
Use higher-level wrappers for the __forkHandler global 2019-10-25 00:10:59 -04:00
Yury Selivanov bed926c500
Avoid double connecting to remote_addr for datagram transports
Issue #276.
2019-10-24 23:01:28 -04:00
Yury Selivanov dd4cb7ac26
Handle unix sockets in UDP
Fixes #269.

Co-authored-by: Dmitry Orlov <me@mosquito.su>
2019-10-24 22:41:12 -04:00
Yury Selivanov 0814a4f6a8
Stop passing the `loop` arg around in in test_spawning_external_process 2019-10-24 22:30:43 -04:00
Adam Bella fde5d14f7d fix - uvloop freeze when something other than uvloop invoke process fork and execute non-python process
Problem:
Uvloop for each loop register `atFork` handler that is called after fork is executed by forked child.
This handler works fine when fork was invoked by uvloop. In case fork is invoked by something else (such as external library)
uvloop freeze in this handler because:
- GIL is acquired inside `atFork` handler -> in case forked child does not contain python runtime `atFork` handler freeze at obtaining GIL
- when compiled in debug mode (`make debug`) cython trace calls are inserted inside compiled `atFork` handler -> in case forked child does not contain python runtime `atFork` handler freeze at providing trace call

Solution:
This fix solve described problems by implementing `atFork` handler as C function so that forked child can call it safely whether or not contains python runtime.
2019-10-24 22:24:16 -04:00
Yury Selivanov 1a0d6578aa
Fix #259: handle large timeouts in loop.call_later() 2019-10-24 22:21:42 -04:00
Yury Selivanov ee02de2bd1
Note that it's recommended to upgrade pip before installing uvloop 2019-10-24 22:18:27 -04:00
Yury Selivanov b849936c7b
issue template: Ask if uvloop behaves differently from vanilla asyncio 2019-10-24 18:12:13 -04:00
Yury Selivanov 34fd827eb1
Bump libuv to v1.33.1 2019-10-24 17:28:39 -04:00
Vladimir Matveev 48d376d30c Keep behavior of run_* consistent with event loops bundled in CPython: ensure that wakeup fd is non-modified if it was not changed before i.e. via calling add_signal_handler 2019-10-24 14:58:29 -04:00
Yury Selivanov 176569118e travis: Add 3.8 to the mix; drop "sudo" 2019-10-24 14:42:54 -04:00
Yury Selivanov 5f48dab8fa tests: Support 3.8 2019-10-24 14:42:54 -04:00
Yury Selivanov 51636f7b72 asyncio.CancelledError is BaseException now, so fix `except Exception` 2019-10-24 14:42:54 -04:00
Yury Selivanov 0bb811d11f tests: Stop using @asyncio.coroutine in tests 2019-10-24 14:42:54 -04:00
Yury Selivanov eb8d7ba170 tests: Stop passing loop explicitly in tests
In 3.8 a lot of asyncio functions have their `loop` parameter
deprecated.  So we change the semantics of uvloop tests to never
pass the loop explicitly (unless to Future objects, when necessary)

That means that we now also need to set up asyncio/uvloop loop policies
for tests in setUp hooks.
2019-10-24 14:42:54 -04:00
Yury Selivanov 65c1a045b5 Bump Cython & pyOpenSSL deps to most recent 2019-10-24 14:42:54 -04:00
Fantix King 5905f27a95 prefer PROTOCOL_TLS than PROTOCOL_SSLv23 2019-10-22 16:47:12 -04:00
Yury Selivanov d9ad177152
Ignore mypy cache 2019-10-22 16:46:30 -04:00
Fantix King 6b91061cff fix test_renegotiation 2019-10-21 13:21:01 -04:00
Fantix King 82104fb68e
add app state check (#263)
* add app state check

* fixes #246

* add test to cover the case

* CRF: rename states and fix comment
2019-08-24 08:02:29 +08:00
Yury Selivanov 1eb6727437 Update libuv to v1.31.0 2019-08-13 18:32:40 -07:00
Toby Harradine ef29dab2c8 Don't log OSError in transports
Resolves #257.
2019-07-17 19:53:50 -07:00
Miro Hrončok 72c8e2aebd sys.set_coroutine_wrapper is removed in Python 3.8
The functions `sys.set_coroutine_wrapper` and `sys.get_coroutine_wrapper`,
which were provisionally added to Python 3.5 and deprecated in Python 3.7,
are removed in Python 3.8.

uvloop doesn't use them since Python 3.7, but they remained defined
in stdlib.pxi, leading to AttributeErrors on Python 3.8+.

This makes the definition fallback to None if such functions don't exist.

Fixes https://github.com/MagicStack/uvloop/issues/251
2019-06-13 12:12:32 -04:00
Yury Selivanov 291afecace Bump Cython to 0.29.10 2019-06-11 16:53:53 -04:00
Yury Selivanov a566599332 Fix compilation warnings under Cython 0.29.10 2019-06-11 16:52:25 -04:00
Fantix King cbbac15f65 enforce TLS<1.3 for SSL renegotiation tests
* fixes #248
2019-05-07 11:18:39 -04:00
Yury Selivanov 6e24e88eb8 A better uvloop.install() example 2019-04-25 12:44:57 -04:00
Yury Selivanov c181ecd333 Promote uvloop.install() to be the default approach 2019-04-25 12:43:24 -04:00
Yury Selivanov 5e5e9988b3 Bump many-linux to 2010 2019-04-23 16:53:18 -04:00
Yury Selivanov a9ecf9e606 Bump the version to 0.14.0.dev0 2019-04-22 12:41:15 -04:00
Yury Selivanov 46c5e9ebe4 Refactor udp.sendto() and pyaddr->sockaddr conversion
* sendto() now tries to use uv_udp_try_send() first

* __convert_pyaddr_to_sockaddr() was optimized to maintain an
  internal LRU cache of resolved addresses (quite an expensive
  operation)
2019-04-16 18:09:29 -04:00