Commit Graph

85936 Commits

Author SHA1 Message Date
R David Murray f1f9675b8a #23251: Note that time.sleep affects the calling thread only.
This change parallels the language used in the unix man page.
2015-01-25 15:45:14 -05:00
Senthil Kumaran e6cc70123e 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.
2015-01-24 19:24:59 -08:00
Vinay Sajip ff37cfe9cc Issue #23305: clarified RotatingFileHandler documentation. 2015-01-23 21:19:04 +00:00
Vinay Sajip 5abca7023c Issue #23207: logging.basicConfig() now does additional validation of its arguments. 2015-01-23 19:52:21 +00:00
Vinay Sajip 71e7296016 Updated pyvenv documentation to match its current behaviour. 2015-01-23 19:35:12 +00:00
Gregory P. Smith 48e810069d 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.
2015-01-22 22:55:00 -08:00
Gregory P. Smith 566646133e 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)
2015-01-22 22:04:16 -08:00
Gregory P. Smith fe7c5d6e4e 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).
2015-01-22 17:33:28 -08:00
Victor Stinner 2b77c5467f 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.
2015-01-22 23:50:03 +01:00
Gregory P. Smith 34cd2ae69f Break up TestCommandLine.test_env_var into four distinct tests. 2015-01-22 14:38:00 -08:00
Victor Stinner 7ffa2c5fdd 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.
2015-01-22 22:55:08 +01:00
Victor Stinner 752aba7f99 asyncio: IocpProactor.close() doesn't cancel anymore futures which are already
cancelled
2015-01-22 22:47:13 +01:00
Victor Stinner f6228f02d7 Issue #23009: Add missing "import sys" in test_selectors 2015-01-22 09:35:23 +01:00
Victor Stinner 14d45c06eb Issue #23009: Skip test_selectors.test_empty_select() on Windows 2015-01-22 09:07:36 +01:00
Victor Stinner 1ca9392c70 Issue #23095, asyncio: IocpProactor.close() must not cancel pending
_WaitCancelFuture futures
2015-01-22 00:17:54 +01:00
Victor Stinner 0c2e408833 asyncio: BaseEventLoop._create_connection_transport() catchs any exception, not
only Exception
2015-01-22 00:17:41 +01:00
Victor Stinner d0a28dee78 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.
2015-01-21 23:39:51 +01:00
Victor Stinner 442b0adccd asyncio: pyflakes, remove unused import
tests: Remove unused function; inline another function
2015-01-21 23:39:16 +01:00
Victor Stinner cd0f7f9832 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.
2015-01-21 23:38:37 +01:00
Gregory P. Smith b5684c48e1 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. :)
2015-01-20 17:19:47 -08:00
Zachary Ware b176d40398 Issue #23280: Fix docstrings for binascii.(un)hexlify 2015-01-20 13:59:46 -06:00
Berker Peksag 5a494f6ad8 Issue #22317: Document the action parameter in ArgumentParser.add_subparsers() docs.
Patch by Mike Short.
2015-01-20 06:45:53 +02:00
Antoine Pitrou 173ad83b07 Issue #23248: Update ssl error codes from latest OpenSSL git master. 2015-01-18 17:39:32 +01:00
Serhiy Storchaka d3faf43f9b Issue #23181: More "codepoint" -> "code point". 2015-01-18 11:28:37 +02:00
Serhiy Storchaka b2653b344e Issue #23098: 64-bit dev_t is now supported in the os module. 2015-01-18 11:12:11 +02:00
Ned Deily ccb416fee2 Issue #23180: Rename IDLE "Windows" menu item to "Window".
Patch by Al Sweigart.
2015-01-17 21:06:27 -08:00
Ned Deily 3bbb37e09b Issue #23211: Fix patch for 3.4 differences. 2015-01-17 17:31:13 -08:00
Ned Deily 1e012e6c7f 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.
2015-01-17 16:57:19 -08:00
Zachary Ware 465b057f91 Closes #23256: Avoid a crash in test_ctypes
Only happened with oddly capitalized debug executables on Windows.
Patch by Claudiu Popa.
2015-01-17 08:50:42 -06:00
Benjamin Peterson bd341629b0 capitialize "HttpOnly" and "Secure" as they appear in the standard and other impls (closes #23250)
Patch by Jon Dufresne.
2015-01-16 20:43:55 -05:00
Victor Stinner f716d8b7a5 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.
2015-01-15 22:52:59 +01:00
Victor Stinner 406204c8c2 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().
2015-01-15 21:50:19 +01:00
Steve Dower cbd3bd59c0 Closes #23160: Respect the environment variable SVNROOT in external-common.bat (patch by anselm.kruis) 2015-01-15 09:16:38 -08:00
Victor Stinner 922bc2ca12 Closes #23219: cancelling asyncio.wait_for() now cancels the task 2015-01-15 16:29:10 +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 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 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 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 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 caa12dab69 Closes #23244: fix typo. Thanks Mayank Tripathi for the patch. 2015-01-15 08:16:01 +01:00
Ethan Furman 8a12329281 Issue22997: minor doc update; thanks to Simoen Visser 2015-01-14 22:31:50 -08:00
Ethan Furman 2f825af728 Issue22988: clarify yield and exception blocks 2015-01-14 22:25:27 -08:00
Ethan Furman 845d33c526 Issue20467: clarify __init__'s role 2015-01-14 21:56:49 -08:00