]> granicus.if.org Git - python/log
python
9 years agoIssue #22079: PyType_Ready() now checks that statically allocated type has
Serhiy Storchaka [Wed, 28 Jan 2015 09:03:33 +0000 (11:03 +0200)]
Issue #22079: PyType_Ready() now checks that statically allocated type has
no dynamically allocated bases.

9 years agoAdded a logging cookbook entry on customized exception formatting.
Vinay Sajip [Wed, 28 Jan 2015 07:32:38 +0000 (07:32 +0000)]
Added a logging cookbook entry on customized exception formatting.

9 years agoasyncio: sync with Tulip
Victor Stinner [Tue, 27 Jan 2015 23:30:40 +0000 (00:30 +0100)]
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.

9 years agoIssue #23286: Fix typo in the tutorial.
Berker Peksag [Tue, 27 Jan 2015 00:52:14 +0000 (02:52 +0200)]
Issue #23286: Fix typo in the tutorial.

Patch by Mayank Tripathi.

9 years agoasyncio, _overlapped.ConnectPipe(): release the GIL
Victor Stinner [Mon, 26 Jan 2015 21:43:39 +0000 (22:43 +0100)]
asyncio, _overlapped.ConnectPipe(): release the GIL

9 years agoasyncio, Tulip issue 204: Fix IocpProactor.recv()
Victor Stinner [Mon, 26 Jan 2015 21:30:49 +0000 (22:30 +0100)]
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().

9 years agoIssue #23095, asyncio: Fix _WaitHandleFuture.cancel()
Victor Stinner [Mon, 26 Jan 2015 21:30:28 +0000 (22:30 +0100)]
Issue #23095, asyncio: Fix _WaitHandleFuture.cancel()

If UnregisterWaitEx() fais with ERROR_IO_PENDING, it doesn't mean that the wait
is unregistered yet. We still have to wait until the wait is cancelled.

9 years agoIssue #23293, asyncio: Rewrite IocpProactor.connect_pipe() as a coroutine
Victor Stinner [Mon, 26 Jan 2015 14:04:03 +0000 (15:04 +0100)]
Issue #23293, asyncio: Rewrite IocpProactor.connect_pipe() as a coroutine

Use a coroutine with asyncio.sleep() instead of call_later() to ensure that the
schedule call is cancelled.

Add also a unit test cancelling connect_pipe().

9 years agoasyncio: PipeHandle.fileno() now raises an exception if the pipe is closed
Victor Stinner [Mon, 26 Jan 2015 14:03:44 +0000 (15:03 +0100)]
asyncio: PipeHandle.fileno() now raises an exception if the pipe is closed

9 years agoasyncio: Fix ProactorEventLoop.start_serving_pipe()
Victor Stinner [Mon, 26 Jan 2015 14:03:20 +0000 (15:03 +0100)]
asyncio: Fix ProactorEventLoop.start_serving_pipe()

If a client connected before the server was closed: drop the client (close the
pipe) and exit.

9 years agoIssue #14099: Backout changeset e5bb3044402b (except adapted tests).
Serhiy Storchaka [Mon, 26 Jan 2015 11:45:39 +0000 (13:45 +0200)]
Issue #14099: Backout changeset e5bb3044402b (except adapted tests).

9 years agoMerge heads
Serhiy Storchaka [Mon, 26 Jan 2015 10:12:31 +0000 (12:12 +0200)]
Merge heads

9 years agoIssue #18518: timeit now rejects statements which can't be compiled outside
Serhiy Storchaka [Mon, 26 Jan 2015 10:09:17 +0000 (12:09 +0200)]
Issue #18518: timeit now rejects statements which can't be compiled outside
a function or a loop (e.g. "return" or "break").

9 years agoIssue #23208, asyncio: Add BaseEventLoop._current_handle
Victor Stinner [Mon, 26 Jan 2015 10:05:12 +0000 (11:05 +0100)]
Issue #23208, asyncio: Add BaseEventLoop._current_handle

In debug mode, BaseEventLoop._run_once() now sets the
BaseEventLoop._current_handle attribute to the handle currently executed.
In release mode or when no handle is executed, the attribute is None.

BaseEventLoop.default_exception_handler() displays the traceback of the current
handle if available.

9 years agoIssue #23293, asyncio: Cleanup IocpProactor.close()
Victor Stinner [Mon, 26 Jan 2015 10:02:59 +0000 (11:02 +0100)]
Issue #23293, asyncio: Cleanup IocpProactor.close()

The special case for connect_pipe() is not more needed. connect_pipe() doesn't
use overlapped operations anymore.

9 years agoasyncio: Close transports on error
Victor Stinner [Mon, 26 Jan 2015 10:02:18 +0000 (11:02 +0100)]
asyncio: Close transports on error

Fix create_datagram_endpoint(), connect_read_pipe() and connect_write_pipe():
close the transport if the task is cancelled or on error.

9 years agoIssue #23094: Fixed readline with frames in Python implementation of pickle.
Serhiy Storchaka [Mon, 26 Jan 2015 08:37:01 +0000 (10:37 +0200)]
Issue #23094: Fixed readline with frames in Python implementation of pickle.

9 years agoIssue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the
Serhiy Storchaka [Mon, 26 Jan 2015 08:26:14 +0000 (10:26 +0200)]
Issue #7665: Fixed tests test_ntpath and test_urllib2 when ran in the
directory containing a backslash.

9 years agoAdd credits for Martin Panter.
Serhiy Storchaka [Mon, 26 Jan 2015 08:14:29 +0000 (10:14 +0200)]
Add credits for Martin Panter.

9 years agoIssue #23268: Fixed bugs in the comparison of ipaddress classes.
Serhiy Storchaka [Mon, 26 Jan 2015 08:11:16 +0000 (10:11 +0200)]
Issue #23268: Fixed bugs in the comparison of ipaddress classes.

9 years agoIssue #21408: The default __ne__() now returns NotImplemented if __eq__()
Serhiy Storchaka [Mon, 26 Jan 2015 07:57:07 +0000 (09:57 +0200)]
Issue #21408: The default __ne__() now returns NotImplemented if __eq__()
returned NotImplemented.  Removed incorrect implementations of __ne__().

9 years agohandle headers with no key (closes #19996)
Benjamin Peterson [Mon, 26 Jan 2015 04:30:30 +0000 (23:30 -0500)]
handle headers with no key (closes #19996)

Patch by Cory Benfield.

9 years agoIssue #23321: Fixed a crash in str.decode() when error handler returned
Serhiy Storchaka [Sun, 25 Jan 2015 23:22:54 +0000 (01:22 +0200)]
Issue #23321: Fixed a crash in str.decode() when error handler returned
replacment string longer than mailformed input data.

9 years ago#23215: reflow paragraph.
R David Murray [Sun, 25 Jan 2015 20:46:22 +0000 (15:46 -0500)]
#23215: reflow paragraph.

9 years ago#23251: Note that time.sleep affects the calling thread only.
R David Murray [Sun, 25 Jan 2015 20:45:14 +0000 (15:45 -0500)]
#23251: Note that time.sleep affects the calling thread only.

This change parallels the language used in the unix man page.

9 years agoIncrease http.client.HTTPConnection test coverage.
Senthil Kumaran [Sun, 25 Jan 2015 03:24:59 +0000 (19:24 -0800)]
Increase http.client.HTTPConnection test coverage.

Added a new tunnel test to verify setting of _tunnel_host, _tunnel_port,
_tunnel_headers attributes on HTTPConnection object.

9 years agoIssue #23305: clarified RotatingFileHandler documentation.
Vinay Sajip [Fri, 23 Jan 2015 21:19:04 +0000 (21:19 +0000)]
Issue #23305: clarified RotatingFileHandler documentation.

9 years agoIssue #23207: logging.basicConfig() now does additional validation of its arguments.
Vinay Sajip [Fri, 23 Jan 2015 19:52:21 +0000 (19:52 +0000)]
Issue #23207: logging.basicConfig() now does additional validation of its arguments.

9 years agoUpdated pyvenv documentation to match its current behaviour.
Vinay Sajip [Fri, 23 Jan 2015 19:35:12 +0000 (19:35 +0000)]
Updated pyvenv documentation to match its current behaviour.

9 years agorevert 7b833bd1f509. I misread the side effect that the code was triggering.
Gregory P. Smith [Fri, 23 Jan 2015 06:55:00 +0000 (22:55 -0800)]
revert 7b833bd1f509.  I misread the side effect that the code was triggering.
*any* kwarg supplied to _assert_python causes it to not append -E to the
command line flags so without='-E' does effectively work.

9 years agoRemove the unimplemented but ignored without='-E' parameters being passed to
Gregory P. Smith [Fri, 23 Jan 2015 06:04:16 +0000 (22:04 -0800)]
Remove the unimplemented but ignored without='-E' parameters being passed to
script_helper.assert_python_failure().  No such feature has ever existed,
thus it doesn't do what the comment claims.  (It does add a 'without'
variable to the environment of the child process but that was not intended)

9 years agoOnly pass -E to the child interpreter if our interpreter was running in that
Gregory P. Smith [Fri, 23 Jan 2015 01:33:28 +0000 (17:33 -0800)]
Only pass -E to the child interpreter if our interpreter was running in that
mode.  Explicitly remove the PYTHONFAULTHANDLER environment variable before
launching a child interpreter when its presence would impact the test (the
reason -E was being used in the first place).

This enables running the test in an environment where other Python environment
variables must be set in order for things to run (such as using PYTHONHOME to
tell an embedded interpreter where it should think it lives).

9 years agoasyncio, Tulip issue 204: Fix IocpProactor.accept_pipe()
Victor Stinner [Thu, 22 Jan 2015 22:50:03 +0000 (23:50 +0100)]
asyncio, Tulip issue 204: Fix IocpProactor.accept_pipe()

Overlapped.ConnectNamedPipe() now returns a boolean: True if the pipe is
connected (if ConnectNamedPipe() failed with ERROR_PIPE_CONNECTED), False if
the connection is in progress.

This change removes multiple hacks in IocpProactor.

9 years agoBreak up TestCommandLine.test_env_var into four distinct tests.
Gregory P. Smith [Thu, 22 Jan 2015 22:38:00 +0000 (14:38 -0800)]
Break up TestCommandLine.test_env_var into four distinct tests.

9 years agoIssue #23293, asyncio: Rewrite IocpProactor.connect_pipe()
Victor Stinner [Thu, 22 Jan 2015 21:55:08 +0000 (22:55 +0100)]
Issue #23293, asyncio: Rewrite IocpProactor.connect_pipe()

Add _overlapped.ConnectPipe() which tries to connect to the pipe for
asynchronous I/O (overlapped): call CreateFile() in a loop until it doesn't
fail with ERROR_PIPE_BUSY. Use an increasing delay between 1 ms and 100 ms.

Remove Overlapped.WaitNamedPipeAndConnect() which is no more used.

9 years agoasyncio: IocpProactor.close() doesn't cancel anymore futures which are already
Victor Stinner [Thu, 22 Jan 2015 21:47:13 +0000 (22:47 +0100)]
asyncio: IocpProactor.close() doesn't cancel anymore futures which are already
cancelled

9 years agoIssue #23009: Add missing "import sys" in test_selectors
Victor Stinner [Thu, 22 Jan 2015 08:35:23 +0000 (09:35 +0100)]
Issue #23009: Add missing "import sys" in test_selectors

9 years agoIssue #23009: Skip test_selectors.test_empty_select() on Windows
Victor Stinner [Thu, 22 Jan 2015 08:07:36 +0000 (09:07 +0100)]
Issue #23009: Skip test_selectors.test_empty_select() on Windows

9 years agoIssue #23095, asyncio: IocpProactor.close() must not cancel pending
Victor Stinner [Wed, 21 Jan 2015 23:17:54 +0000 (00:17 +0100)]
Issue #23095, asyncio: IocpProactor.close() must not cancel pending
_WaitCancelFuture futures

9 years agoasyncio: BaseEventLoop._create_connection_transport() catchs any exception, not
Victor Stinner [Wed, 21 Jan 2015 23:17:41 +0000 (00:17 +0100)]
asyncio: BaseEventLoop._create_connection_transport() catchs any exception, not
only Exception

9 years agoIssue #23095, asyncio: Rewrite _WaitHandleFuture.cancel()
Victor Stinner [Wed, 21 Jan 2015 22:39:51 +0000 (23:39 +0100)]
Issue #23095, asyncio: Rewrite _WaitHandleFuture.cancel()

This change fixes a race conditon related to _WaitHandleFuture.cancel() leading
to Python crash or "GetQueuedCompletionStatus() returned an unexpected event"
logs. Before, the overlapped object was destroyed too early, it was possible
that the wait completed whereas the overlapped object was already destroyed.
Sometimes, a different overlapped was allocated at the same address, leading to
unexpected completition.

_WaitHandleFuture.cancel() now waits until the wait is cancelled to clear its
reference to the overlapped object. To wait until the cancellation is done,
UnregisterWaitEx() is used with an event instead of UnregisterWait().

To wait for this event, a new _WaitCancelFuture class was added. It's a
simplified version of _WaitCancelFuture. For example, its cancel() method calls
UnregisterWait(), not UnregisterWaitEx(). _WaitCancelFuture should not be
cancelled.

The overlapped object is kept alive in _WaitHandleFuture until the wait is
unregistered.

Other changes:

* Add _overlapped.UnregisterWaitEx()
* Remove fast-path in IocpProactor.wait_for_handle() to immediatly set the
  result if the wait already completed. I'm not sure that it's safe to
  call immediatly UnregisterWaitEx() before the completion was signaled.
* Add IocpProactor._unregistered() to forget an overlapped which may never be
  signaled, but may be signaled for the next loop iteration. It avoids to
  block forever IocpProactor.close() if a wait was cancelled, and it may also
  avoid some "... unexpected event ..." warnings.

9 years agoasyncio: pyflakes, remove unused import
Victor Stinner [Wed, 21 Jan 2015 22:39:16 +0000 (23:39 +0100)]
asyncio: pyflakes, remove unused import

tests: Remove unused function; inline another function

9 years agoasyncio: Enhance BaseProactorEventLoop._loop_self_reading()
Victor Stinner [Wed, 21 Jan 2015 22:38:37 +0000 (23:38 +0100)]
asyncio: Enhance BaseProactorEventLoop._loop_self_reading()

* Handle correctly CancelledError: just exit
* On error, log the exception and exit

Don't try to close the event loop, it is probably running and so it cannot be
closed.

9 years agoAdd the command line to the AssertionError raised by test.script_helper's
Gregory P. Smith [Wed, 21 Jan 2015 01:19:47 +0000 (17:19 -0800)]
Add the command line to the AssertionError raised by test.script_helper's
Python subprocess failure assertion error messages for easier debugging.

Adds a unittest for test.script_helper to confirm that this code works as
it is otherwise uncovered by an already passing test suite that uses it. :)

9 years agoIssue #23280: Fix docstrings for binascii.(un)hexlify
Zachary Ware [Tue, 20 Jan 2015 19:59:46 +0000 (13:59 -0600)]
Issue #23280: Fix docstrings for binascii.(un)hexlify

9 years agoIssue #22317: Document the action parameter in ArgumentParser.add_subparsers() docs.
Berker Peksag [Tue, 20 Jan 2015 04:45:53 +0000 (06:45 +0200)]
Issue #22317: Document the action parameter in ArgumentParser.add_subparsers() docs.

Patch by Mike Short.

9 years agoIssue #23248: Update ssl error codes from latest OpenSSL git master.
Antoine Pitrou [Sun, 18 Jan 2015 16:39:32 +0000 (17:39 +0100)]
Issue #23248: Update ssl error codes from latest OpenSSL git master.

9 years agoIssue #23181: More "codepoint" -> "code point".
Serhiy Storchaka [Sun, 18 Jan 2015 09:28:37 +0000 (11:28 +0200)]
Issue #23181: More "codepoint" -> "code point".

9 years agoIssue #23098: 64-bit dev_t is now supported in the os module.
Serhiy Storchaka [Sun, 18 Jan 2015 09:12:11 +0000 (11:12 +0200)]
Issue #23098: 64-bit dev_t is now supported in the os module.

9 years agoIssue #23180: Rename IDLE "Windows" menu item to "Window".
Ned Deily [Sun, 18 Jan 2015 05:06:27 +0000 (21:06 -0800)]
Issue #23180: Rename IDLE "Windows" menu item to "Window".
Patch by Al Sweigart.

9 years agoIssue #23211: Fix patch for 3.4 differences.
Ned Deily [Sun, 18 Jan 2015 01:31:13 +0000 (17:31 -0800)]
Issue #23211: Fix patch for 3.4 differences.

9 years agoIssue #23211: Workaround test_logging failure on some OS X 10.6 systems:
Ned Deily [Sun, 18 Jan 2015 00:57:19 +0000 (16:57 -0800)]
Issue #23211: Workaround test_logging failure on some OS X 10.6 systems:
getaddrinfo("localhost") can fail depending on the name server configuration,
use "127.0.0.0" instead.

9 years agoCloses #23256: Avoid a crash in test_ctypes
Zachary Ware [Sat, 17 Jan 2015 14:50:42 +0000 (08:50 -0600)]
Closes #23256: Avoid a crash in test_ctypes

Only happened with oddly capitalized debug executables on Windows.
Patch by Claudiu Popa.

9 years agocapitialize "HttpOnly" and "Secure" as they appear in the standard and other impls...
Benjamin Peterson [Sat, 17 Jan 2015 01:43:55 +0000 (20:43 -0500)]
capitialize "HttpOnly" and "Secure" as they appear in the standard and other impls (closes #23250)

Patch by Jon Dufresne.

9 years agoIssue #22685: Fix test_pause_reading() of asyncio/test_subprocess
Victor Stinner [Thu, 15 Jan 2015 21:52:59 +0000 (22:52 +0100)]
Issue #22685: Fix test_pause_reading() of asyncio/test_subprocess

Override the connect_read_pipe() method of the loop to mock immediatly
pause_reading() and resume_reading() methods.

The test failed randomly on FreeBSD 9 buildbot and on Windows using trollius.

9 years agoBackout changeset 6ab2575bc12b
Victor Stinner [Thu, 15 Jan 2015 20:50:19 +0000 (21:50 +0100)]
Backout changeset 6ab2575bc12b

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().

9 years agoCloses #23160: Respect the environment variable SVNROOT in external-common.bat (patch...
Steve Dower [Thu, 15 Jan 2015 17:16:38 +0000 (09:16 -0800)]
Closes #23160: Respect the environment variable SVNROOT in external-common.bat (patch by anselm.kruis)

9 years agoCloses #23219: cancelling asyncio.wait_for() now cancels the task
Victor Stinner [Thu, 15 Jan 2015 15:29:10 +0000 (16:29 +0100)]
Closes #23219: cancelling asyncio.wait_for() now cancels the task

9 years agoasyncio: Close transports in tests
Victor Stinner [Thu, 15 Jan 2015 13:24:55 +0000 (14:24 +0100)]
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

9 years agoasyncio: Close the transport on subprocess creation failure
Victor Stinner [Thu, 15 Jan 2015 13:24:22 +0000 (14:24 +0100)]
asyncio: Close the transport on subprocess creation failure

9 years agoasyncio: Fix _ProactorBasePipeTransport.close()
Victor Stinner [Thu, 15 Jan 2015 12:40:27 +0000 (13:40 +0100)]
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().

9 years agoasyncio: Fix _ProactorBasePipeTransport.__repr__()
Victor Stinner [Thu, 15 Jan 2015 12:32:28 +0000 (13:32 +0100)]
asyncio: Fix _ProactorBasePipeTransport.__repr__()

Check if the _sock attribute is None to check if the transport is closed.

9 years agoIssue #23243: Close explicitly transports in asyncio tests
Victor Stinner [Thu, 15 Jan 2015 12:18:32 +0000 (13:18 +0100)]
Issue #23243: Close explicitly transports in asyncio tests

9 years agoIssue #23243: Close explicitly event loops in asyncio tests
Victor Stinner [Thu, 15 Jan 2015 12:17:34 +0000 (13:17 +0100)]
Issue #23243: Close explicitly event loops in asyncio tests

9 years agoIssue #23243: Fix asyncio._UnixWritePipeTransport.close()
Victor Stinner [Thu, 15 Jan 2015 12:16:50 +0000 (13:16 +0100)]
Issue #23243: Fix asyncio._UnixWritePipeTransport.close()

Do nothing if the transport is already closed. Before it was not possible to
close the transport twice.

9 years agoSSLProtocol: set the _transport attribute in the constructor
Victor Stinner [Thu, 15 Jan 2015 12:16:27 +0000 (13:16 +0100)]
SSLProtocol: set the _transport attribute in the constructor

9 years agoIssue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess
Victor Stinner [Thu, 15 Jan 2015 12:16:02 +0000 (13:16 +0100)]
Issue #23242: asyncio.SubprocessStreamProtocol now closes the subprocess
transport at subprocess exit.

Clear also its reference to the transport.

10 years agoIssue #22560: Fix typo: call -> call_soon
Victor Stinner [Thu, 15 Jan 2015 08:44:13 +0000 (09:44 +0100)]
Issue #22560: Fix typo: call -> call_soon

10 years agoIssue #22560: Fix SSLProtocol._on_handshake_complete()
Victor Stinner [Thu, 15 Jan 2015 08:41:48 +0000 (09:41 +0100)]
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.

10 years agoStreamWriter: close() now clears the reference to the transport
Victor Stinner [Thu, 15 Jan 2015 08:33:50 +0000 (09:33 +0100)]
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().

10 years agoCloses #23244: fix typo. Thanks Mayank Tripathi for the patch.
Georg Brandl [Thu, 15 Jan 2015 07:16:01 +0000 (08:16 +0100)]
Closes #23244: fix typo. Thanks Mayank Tripathi for the patch.

10 years agoIssue22997: minor doc update; thanks to Simoen Visser
Ethan Furman [Thu, 15 Jan 2015 06:31:50 +0000 (22:31 -0800)]
Issue22997: minor doc update; thanks to Simoen Visser

10 years agoIssue22988: clarify yield and exception blocks
Ethan Furman [Thu, 15 Jan 2015 06:25:27 +0000 (22:25 -0800)]
Issue22988: clarify yield and exception blocks

10 years agoIssue20467: clarify __init__'s role
Ethan Furman [Thu, 15 Jan 2015 05:56:49 +0000 (21:56 -0800)]
Issue20467: clarify __init__'s role

10 years agoIssue20467: clarify __init__'s role
Ethan Furman [Thu, 15 Jan 2015 05:56:10 +0000 (21:56 -0800)]
Issue20467: clarify __init__'s role

10 years agofix parsing reST with code or code-block directives (closes #23063)
Benjamin Peterson [Thu, 15 Jan 2015 04:56:35 +0000 (23:56 -0500)]
fix parsing reST with code or code-block directives (closes #23063)

Patch by Marc Abramowitz.

10 years agoasyncio: sync with Tulip
Victor Stinner [Wed, 14 Jan 2015 23:04:21 +0000 (00:04 +0100)]
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.

10 years agoIssue #23197: On SSL handshake failure on matching hostname, check if the
Victor Stinner [Wed, 14 Jan 2015 16:13:28 +0000 (17:13 +0100)]
Issue #23197: On SSL handshake failure on matching hostname, check if the
waiter is cancelled before setting its exception.

10 years agoIssue #23197, asyncio: On SSL handshake failure, check if the waiter is
Victor Stinner [Wed, 14 Jan 2015 15:56:20 +0000 (16:56 +0100)]
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

10 years agoPython issue #23173: sync with Tulip
Victor Stinner [Wed, 14 Jan 2015 01:10:33 +0000 (02:10 +0100)]
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.

10 years agoIssue #23198: Reactor asyncio.StreamReader
Victor Stinner [Tue, 13 Jan 2015 23:53:37 +0000 (00:53 +0100)]
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

10 years agoIssue #22560: New SSL implementation based on ssl.MemoryBIO
Victor Stinner [Tue, 13 Jan 2015 23:19:09 +0000 (00:19 +0100)]
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.

10 years agoTulip issue 184: Fix test_pipe() on Windows
Victor Stinner [Tue, 13 Jan 2015 15:13:06 +0000 (16:13 +0100)]
Tulip issue 184: Fix test_pipe() on Windows

Pass explicitly the event loop to StreamReaderProtocol.

10 years agoIssue #22922: Fix ProactorEventLoop.close()
Victor Stinner [Tue, 13 Jan 2015 15:11:19 +0000 (16:11 +0100)]
Issue #22922: Fix ProactorEventLoop.close()

Close the IocpProactor before closing the event loop. IocpProactor.close() can
call loop.call_soon(), which is forbidden when the event loop is closed.

10 years agofix instances of consecutive articles (closes #23221)
Benjamin Peterson [Tue, 13 Jan 2015 14:17:24 +0000 (09:17 -0500)]
fix instances of consecutive articles (closes #23221)

Patch by Karan Goel.

10 years agoIssue #23209, #23225: selectors.BaseSelector.close() now clears its internal
Victor Stinner [Tue, 13 Jan 2015 08:58:33 +0000 (09:58 +0100)]
Issue #23209, #23225: selectors.BaseSelector.close() now clears its internal
reference to the selector mapping to break a reference cycle. Initial patch
written by Martin Richard.

10 years agoUpdate setuptools to 11.3.1
Donald Stufft [Sun, 11 Jan 2015 20:51:11 +0000 (15:51 -0500)]
Update setuptools to 11.3.1

10 years agoIssue #22952: improve multiprocessing doc introduction and defer notes until appropriate.
Antoine Pitrou [Sun, 11 Jan 2015 14:05:29 +0000 (15:05 +0100)]
Issue #22952: improve multiprocessing doc introduction and defer notes until appropriate.

Patch by Davin Potts.

10 years agoIssue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic...
Mark Dickinson [Sun, 11 Jan 2015 13:08:05 +0000 (13:08 +0000)]
Issue #21902: Replace incorrect 'hyperbolic arc sine' (etc.) with 'inverse hyperbolic sine' (etc.).  Remove meaningless reference to radians.

10 years agoremove buzzword (closes #23210)
Benjamin Peterson [Fri, 9 Jan 2015 22:40:23 +0000 (16:40 -0600)]
remove buzzword (closes #23210)

10 years agoIssue #23212: 3.4-specific OS X installer updates
Ned Deily [Fri, 9 Jan 2015 21:30:11 +0000 (13:30 -0800)]
Issue #23212: 3.4-specific OS X installer updates

10 years agoIssue #23212: Update OS X installer build OpenSSL to 1.0.1k.
Ned Deily [Fri, 9 Jan 2015 21:29:54 +0000 (13:29 -0800)]
Issue #23212: Update OS X installer build OpenSSL to 1.0.1k.
(currently only used for builds with <= 10.5 deployment targets)

10 years agoIssue #23209: Revert change on selectors, test_selectors failed.
Victor Stinner [Fri, 9 Jan 2015 20:56:28 +0000 (21:56 +0100)]
Issue #23209: Revert change on selectors, test_selectors failed.

10 years agoIssue #23209: Break some reference cycles in asyncio. Patch written by Martin
Victor Stinner [Fri, 9 Jan 2015 20:34:27 +0000 (21:34 +0100)]
Issue #23209: Break some reference cycles in asyncio. Patch written by Martin
Richard.

10 years agoasyncio: sync with Tulip
Victor Stinner [Fri, 9 Jan 2015 20:32:05 +0000 (21:32 +0100)]
asyncio: sync with Tulip

* Tulip issue 184: FlowControlMixin constructor now get the event loop if the
  loop parameter is not set. Add unit tests to ensure that constructor of
  StreamReader and StreamReaderProtocol classes get the event loop.
* Remove outdated TODO/XXX

10 years agoasyncio: SelectSelector is limited to 512 sockets on Windows
Victor Stinner [Fri, 9 Jan 2015 14:59:44 +0000 (15:59 +0100)]
asyncio: SelectSelector is limited to 512 sockets on Windows

10 years agoasyncio doc: fix section of event loop examples
Victor Stinner [Fri, 9 Jan 2015 14:58:41 +0000 (15:58 +0100)]
asyncio doc: fix section of event loop examples

10 years agoasyncio: sync with Tulip
Victor Stinner [Fri, 9 Jan 2015 00:42:52 +0000 (01:42 +0100)]
asyncio: sync with Tulip

* Document why set_result() calls are safe
* Cleanup gather(). Use public methods instead of hacks to consume the
  exception of a future.
* sock_connect(): pass directly the fd to _sock_connect_done instead of the
  socket.

10 years agoasyncio doc: list limitations to run subprocesses from different threads
Victor Stinner [Fri, 9 Jan 2015 00:32:02 +0000 (01:32 +0100)]
asyncio doc: list limitations to run subprocesses from different threads

10 years agoasyncio: Truncate to 80 columns
Victor Stinner [Thu, 8 Jan 2015 23:09:10 +0000 (00:09 +0100)]
asyncio: Truncate to 80 columns