Commit graph

87933 commits

Author SHA1 Message Date
Victor Stinner
49b74d1a91 Merge 3.4 (asyncio) 2015-01-30 00:16:31 +01:00
Victor Stinner
1241ecc21b Issue #23347, asyncio: Make BaseSubprocessTransport.wait() private 2015-01-30 00:16:14 +01:00
Victor Stinner
698a9bd3ba Merge 3.4 (asyncio) 2015-01-30 00:11:55 +01:00
Victor Stinner
0698638d79 asyncio: Fix ResourceWarning in test_subprocess.test_proc_exit() 2015-01-30 00:11:42 +01:00
Victor Stinner
a9373ec966 Merge 3.4 (asyncio) 2015-01-30 00:05:36 +01:00
Victor Stinner
47cd10d7a9 asyncio: sync with Tulip
Issue #23347: send_signal(), kill() and terminate() methods of
BaseSubprocessTransport now check if the transport was closed and if the
process exited.

Issue #23347: Refactor creation of subprocess transports. Changes on
BaseSubprocessTransport:

* Add a wait() method to wait until the child process exit
* The constructor now accepts an optional waiter parameter. The _post_init()
  coroutine must not be called explicitly anymore. It makes subprocess
  transports closer to other transports, and it gives more freedom if we want
  later to change completly how subprocess transports are created.
* close() now kills the process instead of kindly terminate it: the child
  process may ignore SIGTERM and continue to run. Call explicitly terminate()
  and wait() if you want to kindly terminate the child process.
* close() now logs a warning in debug mode if the process is still running and
  needs to be killed
* _make_subprocess_transport() is now fully asynchronous again: if the creation
  of the transport failed, wait asynchronously for the process eixt. Before the
  wait was synchronous. This change requires close() to *kill*, and not
  terminate, the child process.
* Remove the _kill_wait() method, replaced with a more agressive close()
  method. It fixes _make_subprocess_transport() on error.
  BaseSubprocessTransport.close() calls the close() method of pipe transports,
  whereas _kill_wait() closed directly pipes of the subprocess.Popen object
  without unregistering file descriptors from the selector (which caused severe
  bugs).

These changes simplifies the code of subprocess.py.
2015-01-30 00:05:19 +01:00
Victor Stinner
2647375cc9 Merge 3.4 (asyncio) 2015-01-30 00:04:27 +01:00
Victor Stinner
978a9afc6a Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transport
is not explicitly closed. Close also explicitly transports in test_sslproto.
2015-01-29 17:50:58 +01:00
Stefan Krah
29b40c1569 Issue #22668: Merge from 3.4. 2015-01-29 17:40:59 +01:00
Stefan Krah
3c0cf05901 Issue #22668: Remove endianness assumption in test. 2015-01-29 17:33:31 +01:00
Stefan Krah
fc341bd4c5 Whitespace. 2015-01-29 14:33:37 +01:00
Stefan Krah
f5324d7074 Closes #22668: Merge from 3.4. 2015-01-29 14:29:51 +01:00
Stefan Krah
fa5d6a5ff3 Issue #22668: Ensure that format strings survive slicing after casting. 2015-01-29 14:27:23 +01:00
Victor Stinner
6d14405fdb Merge 3.4 (asyncio) 2015-01-29 14:15:42 +01:00
Victor Stinner
2934262fd3 asyncio: sync with Tulip
* Cleanup gather(): use cancelled() method instead of using private Future
  attribute
* Fix _UnixReadPipeTransport and _UnixWritePipeTransport. Only start reading
  when connection_made() has been called.
* Issue #23333: Fix BaseSelectorEventLoop._accept_connection(). Close the
  transport on error. In debug mode, log errors using call_exception_handler()
2015-01-29 14:15:19 +01:00
Victor Stinner
3e48d77bcb Merge 3.4 (asyncio doc) 2015-01-29 13:33:28 +01:00
Victor Stinner
54a231d539 asyncio doc: document Protocol state machine 2015-01-29 13:33:15 +01:00
Victor Stinner
52fa138aac Merge 3.4 (asyncio) 2015-01-29 02:57:10 +01:00
Victor Stinner
47bbea7124 asyncio: sync with Tulip
* _SelectorTransport constructor: extra parameter is now optional
* Fix _SelectorDatagramTransport constructor. Only start reading after
  connection_made() has been called.
* Fix _SelectorSslTransport.close(). Don't call protocol.connection_lost() if
  protocol.connection_made() was not called yet: if the SSL handshake failed or
  is still in progress. The close() method can be called if the creation of the
  connection is cancelled, by a timeout for example.
2015-01-29 02:56:05 +01:00
Victor Stinner
c84d167733 Merge 3.4 (asyncio) 2015-01-29 02:15:35 +01:00
Victor Stinner
7b5a900e88 asyncio: BaseSubprocessTransport._kill_wait() now also call close()
close() closes pipes, which is not None yet by _kill_wait().
2015-01-29 02:14:30 +01:00
Gregory P. Smith
bd4976bbd3 Always #define _PyLong_FromDev as we always need it to compile rather than
only defining it when HAVE_MKNOD && HAVE_MAKEDEV are true.

This "oops" issue reported by John E. Malmberg on core-mentorship.
(what kinds of systems don't HAVE_MKNOD && HAVE_MAKEDEV?)
2015-01-28 16:08:07 -08:00
Gregory P. Smith
702dada2c5 Always #define _PyLong_FromDev as we always need it to compile rather than
only defining it when HAVE_MKNOD && HAVE_MAKEDEV are true.

This "oops" issue reported by John E. Malmberg on core-mentorship.
(what kinds of systems don't HAVE_MKNOD && HAVE_MAKEDEV?)
2015-01-28 16:07:52 -08:00
Victor Stinner
bea0a28439 Merge 3.4 (asyncio) 2015-01-29 00:55:46 +01:00
Victor Stinner
fa73779b0a asyncio: Fix _SelectorSocketTransport constructor
Only start reading when connection_made() has been called:
protocol.data_received() must not be called before protocol.connection_made().
2015-01-29 00:36:51 +01:00
Victor Stinner
f07801bb17 asyncio: SSL transports now clear their reference to the waiter
* Rephrase also the comment explaining why the waiter is not awaken immediatly.
* SSLProtocol.eof_received() doesn't instanciate ConnectionResetError exception
  directly, it will be done by Future.set_exception(). The exception is not
  used if the waiter was cancelled or if there is no waiter.
2015-01-29 00:36:35 +01:00
Victor Stinner
b507cbaac5 asyncio: Fix SSLProtocol.eof_received()
Wake-up the waiter if it is not done yet.
2015-01-29 00:35:56 +01:00
Donald Stufft
6b9e2009fa Merge 3.4 into default - Upgrade setuptools to 12.0.5 and pip to 6.0.7 2015-01-28 17:57:05 -05:00
Donald Stufft
a89f5f0492 Update setuptools to 12.0.5 and pip to 6.0.7 2015-01-28 17:56:15 -05:00
Benjamin Peterson
c54de47759 ifdef our way to compatibility with old openssl (closes #23335) 2015-01-28 12:06:39 -05:00
Serhiy Storchaka
aaef05f003 Fixed memory leak in marshal. 2015-01-28 17:11:12 +02:00
Serhiy Storchaka
000daaee57 Fixed memory leak in marshal. 2015-01-28 17:10:48 +02:00
Serhiy Storchaka
66acbb28ee Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.
2015-01-28 11:06:04 +02:00
Serhiy Storchaka
e09bcc874a Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.
2015-01-28 11:03:33 +02:00
Vinay Sajip
85ad88dbc6 Merged documentation update from 3.4. 2015-01-28 07:33:14 +00:00
Vinay Sajip
db07164053 Added a logging cookbook entry on customized exception formatting. 2015-01-28 07:32:38 +00:00
Victor Stinner
bf9765186d Merge 3.4 (asyncio) 2015-01-28 00:30:51 +01:00
Victor Stinner
ff018e406c asyncio: sync with Tulip
* Remove unused SSLProtocol._closing attribute
* test_sslproto: skip test if ssl module is missing
* Python issue #23208: Don't use the traceback of the current handle if we
  already know the traceback of the source. The handle may be more revelant,
  but having 3 tracebacks (handle, source, exception) becomes more difficult to
  read. The handle may be preferred later but it requires more work to make
  this choice.
2015-01-28 00:30:40 +01:00
Benjamin Peterson
07f0515667 disable ALPN on LibreSSL, which has a large version number, but not ALPN support (closes #23329) 2015-01-27 11:10:18 -05:00
Raymond Hettinger
f8d1a31e70 Revert unintended part of the commit (the key==dummy test wasn't supposed to change). 2015-01-26 22:06:43 -08:00
Raymond Hettinger
a5ebbf6295 Remove unneeded dummy test from the set search loop (when the hashes match we know the key is not a dummy). 2015-01-26 21:54:35 -08:00
Raymond Hettinger
3037e84ad1 Issue #23269: Tighten search_loop in set_insert_clean()
Instead of masking and shifting every loopup, move the wrap-around
test outside of the inner-loop.
2015-01-26 21:33:48 -08:00
Berker Peksag
618e315f93 Add whatsnew entry for issue #5309. 2015-01-27 02:59:09 +02:00
Berker Peksag
b820d0defc Issue #23286: Fix typo in the tutorial.
Patch by Mayank Tripathi.
2015-01-27 02:52:40 +02:00
Berker Peksag
b68c420d8a Issue #23286: Fix typo in the tutorial.
Patch by Mayank Tripathi.
2015-01-27 02:52:14 +02:00
Victor Stinner
f2be23d329 Issue #22286, #23321: Fix failing test on Windows code page 932
There was a bug which was fixed. The unit test was also wrong.
2015-01-26 23:26:11 +01:00
Victor Stinner
3bf8684c5e Merge 3.4 (asyncio) 2015-01-26 22:43:52 +01:00
Victor Stinner
498b1f62db asyncio, _overlapped.ConnectPipe(): release the GIL 2015-01-26 22:43:39 +01:00
Victor Stinner
c27a8afcb0 Merge 3.4 (asyncio) 2015-01-26 22:31:03 +01:00
Victor Stinner
41063d2a59 asyncio, Tulip issue 204: Fix IocpProactor.recv()
If ReadFile() fails with ERROR_BROKEN_PIPE, the operation is not pending: don't
register the overlapped.

I don't know if WSARecv() can fail with ERROR_BROKEN_PIPE. Since
Overlapped.WSARecv() already handled ERROR_BROKEN_PIPE, let me guess that it
has the same behaviour than ReadFile().
2015-01-26 22:30:49 +01:00