Commit graph

89061 commits

Author SHA1 Message Date
Steve Dower
2587952f2f Fixes sys.winver generation and removes dependency on user32.dll 2015-01-15 09:10:16 -08:00
Victor Stinner
a39eb0f42b Merge 3.4 (asyncio) 2015-01-15 16:29:23 +01:00
Victor Stinner
922bc2ca12 Closes #23219: cancelling asyncio.wait_for() now cancels the task 2015-01-15 16:29:10 +01:00
Victor Stinner
9fef5244eb Merge 3.4 (asyncio) 2015-01-15 14:25:08 +01:00
Victor Stinner
ab8848bc2a asyncio: Close transports in tests
* Use test_utils.run_briefly() to execute pending calls to really close
  transports
* sslproto: mock also _SSLPipe.shutdown(), it's need to close the transport
* pipe test: the test doesn't close explicitly the PipeHandle, so ignore
  the warning instead
* test_popen: use the context manager ("with p:") to explicitly close pipes
2015-01-15 14:24:55 +01:00
Victor Stinner
4bf22e033e asyncio: Close the transport on subprocess creation failure 2015-01-15 14:24:22 +01:00
Victor Stinner
d021c1d395 Merge 3.4 (asyncio) 2015-01-15 13:41:01 +01:00
Victor Stinner
fcd58de78f asyncio: Fix _ProactorBasePipeTransport.close()
Set the _read_fut attribute to None after cancelling it.

This change should fix a race condition with
_ProactorWritePipeTransport._pipe_closed().
2015-01-15 13:40:27 +01:00
Victor Stinner
79c93ba47b asyncio: Fix _ProactorBasePipeTransport.__repr__()
Check if the _sock attribute is None to check if the transport is closed.
2015-01-15 13:32:28 +01:00
Victor Stinner
7d78d0d91c Merge 3.4 (asyncio) 2015-01-15 13:23:36 +01:00
Victor Stinner
02392c9282 Issue #23243: Close explicitly transports in asyncio tests 2015-01-15 13:18:32 +01:00
Victor Stinner
33cb0396e8 Issue #23243: Close explicitly event loops in asyncio tests 2015-01-15 13:17:34 +01:00
Victor Stinner
41ed958ee6 Issue #23243: Fix asyncio._UnixWritePipeTransport.close()
Do nothing if the transport is already closed. Before it was not possible to
close the transport twice.
2015-01-15 13:16:50 +01:00
Victor Stinner
7e222f411c SSLProtocol: set the _transport attribute in the constructor 2015-01-15 13:16:27 +01:00
Victor Stinner
791009bb89 Issue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess
transport at subprocess exit.

Clear also its reference to the transport.
2015-01-15 13:16:02 +01:00
Victor Stinner
fe47e66792 Merge 3.4 (asyncio) 2015-01-15 09:44:24 +01:00
Victor Stinner
72bdefb086 Issue #22560: Fix typo: call -> call_soon 2015-01-15 09:44:13 +01:00
Victor Stinner
042dad7232 Issue #22560: Fix SSLProtocol._on_handshake_complete()
Don't call immediatly self._process_write_backlog() but schedule the call using
call_soon(). _on_handshake_complete() can be called indirectly from
_process_write_backlog(), and _process_write_backlog() is not reentrant.
2015-01-15 09:41:48 +01:00
Victor Stinner
516aaa116a Merge 3.4 (asyncio) 2015-01-15 09:35:29 +01:00
Victor Stinner
e7a35717d2 StreamWriter: close() now clears the reference to the transport
StreamWriter now raises an exception if it is closed: write(), writelines(),
write_eof(), can_write_eof(), get_extra_info(), drain().
2015-01-15 09:33:50 +01:00
Georg Brandl
0443c92ee1 merge with 3.4 2015-01-15 08:16:25 +01:00
Georg Brandl
caa12dab69 Closes #23244: fix typo. Thanks Mayank Tripathi for the patch. 2015-01-15 08:16:01 +01:00
Ethan Furman
61f50bb488 Issue22997: minor doc update; thanks to Simoen Visser 2015-01-14 22:32:29 -08:00
Ethan Furman
8a12329281 Issue22997: minor doc update; thanks to Simoen Visser 2015-01-14 22:31:50 -08:00
Ethan Furman
e62430eda4 Issue22988: clarify yield and exception blocks 2015-01-14 22:26:04 -08:00
Ethan Furman
2f825af728 Issue22988: clarify yield and exception blocks 2015-01-14 22:25:27 -08:00
Ethan Furman
9fdb0fe17b Issue20467: clarify __init__'s role 2015-01-14 21:57:15 -08:00
Ethan Furman
845d33c526 Issue20467: clarify __init__'s role 2015-01-14 21:56:49 -08:00
Ethan Furman
119479f705 Issue20467: clarify __init__'s role 2015-01-14 21:56:10 -08:00
Benjamin Peterson
71f1c5c496 merge 3.4 (#23063) 2015-01-15 00:00:16 -05:00
Benjamin Peterson
562b7cbff9 fix parsing reST with code or code-block directives (closes #23063)
Patch by Marc Abramowitz.
2015-01-14 23:56:35 -05:00
Victor Stinner
93e42c03b7 Merge 3.4 (asyncio) 2015-01-15 00:05:18 +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
24be20ac1c Merge 3.4 (asyncio) 2015-01-14 17:13:43 +01:00
Victor Stinner
b92626df5c Issue #23197: On SSL handshake failure on matching hostname, check if the
waiter is cancelled before setting its exception.
2015-01-14 17:13:28 +01:00
Victor Stinner
a5e881d2e8 Closes #23234: Refactor subprocess
Use new OSError exceptions, factorize stdin.write() code.
2015-01-14 17:07:59 +01:00
Victor Stinner
f664118817 Merge 3.4 (asyncio) 2015-01-14 17:00:29 +01:00
Victor Stinner
177e9f0855 Issue #23197, asyncio: On SSL handshake failure, check if the waiter is
cancelled before setting its exception.

* Add unit tests for this case.
* Cleanup also sslproto.py
2015-01-14 16:56:20 +01:00
Victor Stinner
923e06f77d Issue #22038, configure: HAVE_STD_ATOMIC now also check that "atomic_int" and
"_Atomic void*" types work. Change needed on FreeBSD 10 where stdatomic.h is
available but the compiler fails on "_Atomic void*" with "_Atomic cannot be
applied to incomplete type 'void'".
2015-01-14 16:01:46 +01:00
Georg Brandl
3be472b5f7 Closes #23181: codepoint -> code point 2015-01-14 08:26:30 +01:00
Raymond Hettinger
1a8ada89f9 No need to rebuild a constant dictionary on every call. Move convert mapping to module level. 2015-01-13 22:57:35 -08:00
Victor Stinner
e54dd0b92b Merge 3.4 (asyncio) 2015-01-14 02:13:51 +01:00
Victor Stinner
f651a60407 Python issue #23173: sync with Tulip
* If an exception is raised during the creation of a subprocess, kill the
  subprocess (close pipes, kill and read the return status). Log an error in
  such case.
* Fix SubprocessStreamProtocol.connection_made() to handle cancelled waiter.
  Add unit test cancelling subprocess methods.
2015-01-14 02:10:33 +01:00
Victor Stinner
9f5b6907ab Merge 3.4 (asyncio) 2015-01-14 00:54:00 +01:00
Victor Stinner
c2c12e433a Issue #23198: Reactor asyncio.StreamReader
- Add a new _wakeup_waiter() method
- Replace _create_waiter() method with a _wait_for_data() coroutine function
- Use the value None instead of True or False to wake up the waiter
2015-01-14 00:53:37 +01:00
Victor Stinner
4ec042278f Issue #22560, asyncio doc: ProactorEventLoop now supports SSL! 2015-01-14 00:30:22 +01:00
Victor Stinner
81a04f7ad4 Merge 3.4 (asyncio: new SSL implementation) 2015-01-14 00:19:55 +01:00
Victor Stinner
231b404cb0 Issue #22560: New SSL implementation based on ssl.MemoryBIO
The new SSL implementation is based on the new ssl.MemoryBIO which is only
available on Python 3.5. On Python 3.4 and older, the legacy SSL implementation
(using SSL_write, SSL_read, etc.) is used. The proactor event loop only
supports the new implementation.

The new asyncio.sslproto module adds _SSLPipe, SSLProtocol and
_SSLProtocolTransport classes. _SSLPipe allows to "wrap" or "unwrap" a socket
(switch between cleartext and SSL/TLS).

Patch written by Antoine Pitrou. sslproto.py is based on gruvi/ssl.py of the
gruvi project written by Geert Jansen.

This change adds SSL support to ProactorEventLoop on Python 3.5 and newer!

It becomes also possible to implement STARTTTLS: switch a cleartext socket to
SSL.
2015-01-14 00:19:09 +01:00
Victor Stinner
7d5a95627b Merge 3.4 (asyncio) 2015-01-13 16:13:36 +01:00
Victor Stinner
9036e49ba1 Tulip issue 184: Fix test_pipe() on Windows
Pass explicitly the event loop to StreamReaderProtocol.
2015-01-13 16:13:06 +01:00