]> granicus.if.org Git - python/log
python
10 years agoMerged documentation update from 3.4.
Vinay Sajip [Wed, 28 Jan 2015 07:33:14 +0000 (07:33 +0000)]
Merged documentation update from 3.4.

10 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.

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Tue, 27 Jan 2015 23:30:51 +0000 (00:30 +0100)]
Merge 3.4 (asyncio)

10 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.

10 years agodisable ALPN on LibreSSL, which has a large version number, but not ALPN support...
Benjamin Peterson [Tue, 27 Jan 2015 16:10:18 +0000 (11:10 -0500)]
disable ALPN on LibreSSL, which has a large version number, but not ALPN support (closes #23329)

10 years agoRevert unintended part of the commit (the key==dummy test wasn't supposed to change).
Raymond Hettinger [Tue, 27 Jan 2015 06:06:43 +0000 (22:06 -0800)]
Revert unintended part of the commit (the key==dummy test wasn't supposed to change).

10 years agoRemove unneeded dummy test from the set search loop (when the hashes match we know...
Raymond Hettinger [Tue, 27 Jan 2015 05:54:35 +0000 (21:54 -0800)]
Remove unneeded dummy test from the set search loop (when the hashes match we know the key is not a dummy).

10 years agoIssue #23269: Tighten search_loop in set_insert_clean()
Raymond Hettinger [Tue, 27 Jan 2015 05:33:48 +0000 (21:33 -0800)]
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.

10 years agoAdd whatsnew entry for issue #5309.
Berker Peksag [Tue, 27 Jan 2015 00:59:09 +0000 (02:59 +0200)]
Add whatsnew entry for issue #5309.

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

Patch by Mayank Tripathi.

10 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.

10 years agoIssue #22286, #23321: Fix failing test on Windows code page 932
Victor Stinner [Mon, 26 Jan 2015 22:26:11 +0000 (23:26 +0100)]
Issue #22286, #23321: Fix failing test on Windows code page 932

There was a bug which was fixed. The unit test was also wrong.

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Mon, 26 Jan 2015 21:43:52 +0000 (22:43 +0100)]
Merge 3.4 (asyncio)

10 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

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Mon, 26 Jan 2015 21:31:03 +0000 (22:31 +0100)]
Merge 3.4 (asyncio)

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

10 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.

10 years agoIssue #20284: Fix a compilation warning on Windows
Victor Stinner [Mon, 26 Jan 2015 15:43:36 +0000 (16:43 +0100)]
Issue #20284: Fix a compilation warning on Windows

Explicitly cast the long to char.

10 years agoIssue #15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and
Victor Stinner [Mon, 26 Jan 2015 15:41:32 +0000 (16:41 +0100)]
Issue #15859: PyUnicode_EncodeFSDefault(), PyUnicode_EncodeMBCS() and
PyUnicode_EncodeCodePage() now raise an exception if the object is not an
Unicode object. For PyUnicode_EncodeFSDefault(), it was already the case on
platforms other than Windows. Patch written by Campbell Barton.

10 years agoensure ilen is initialized when it is assigned to len
Benjamin Peterson [Mon, 26 Jan 2015 14:23:41 +0000 (09:23 -0500)]
ensure ilen is initialized when it is assigned to len

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Mon, 26 Jan 2015 14:04:15 +0000 (15:04 +0100)]
Merge 3.4 (asyncio)

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

10 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

10 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.

10 years agoIssue #14099: Restored support of writing ZIP files to tellable but
Serhiy Storchaka [Mon, 26 Jan 2015 12:01:27 +0000 (14:01 +0200)]
Issue #14099: Restored support of writing ZIP files to tellable but
non-seekable streams.

10 years agoIssue #14099: Writing to ZipFile and reading multiple ZipExtFiles is
Serhiy Storchaka [Mon, 26 Jan 2015 11:53:38 +0000 (13:53 +0200)]
Issue #14099: Writing to ZipFile and reading multiple ZipExtFiles is
threadsafe now.

10 years agoNull merge
Serhiy Storchaka [Mon, 26 Jan 2015 11:47:52 +0000 (13:47 +0200)]
Null merge

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

10 years agoIssue #19361: JSON decoder now raises JSONDecodeError instead of ValueError.
Serhiy Storchaka [Mon, 26 Jan 2015 11:16:30 +0000 (13:16 +0200)]
Issue #19361: JSON decoder now raises JSONDecodeError instead of ValueError.

10 years agoNull merge
Serhiy Storchaka [Mon, 26 Jan 2015 10:14:37 +0000 (12:14 +0200)]
Null merge

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

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

10 years agoIssue #18518: timeit now rejects statements which can't be compiled outside
Serhiy Storchaka [Mon, 26 Jan 2015 10:09:59 +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").

10 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").

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Mon, 26 Jan 2015 10:05:34 +0000 (11:05 +0100)]
Merge 3.4 (asyncio)

10 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.

10 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.

10 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.

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

10 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.

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

10 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.

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

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

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

10 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.

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

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

10 years agoDon't use deprecated assertEquals.
Serhiy Storchaka [Mon, 26 Jan 2015 07:28:11 +0000 (09:28 +0200)]
Don't use deprecated assertEquals.

10 years agomerge 3.4 (#19996)
Benjamin Peterson [Mon, 26 Jan 2015 04:31:58 +0000 (23:31 -0500)]
merge 3.4 (#19996)

10 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.

10 years agoSet the hash values of dummy entries to -1. Improves quality of entry->hash == hash...
Raymond Hettinger [Mon, 26 Jan 2015 00:38:52 +0000 (16:38 -0800)]
Set the hash values of dummy entries to -1.  Improves quality of entry->hash == hash tests.

10 years agoUpdate out-of-date comments.
Raymond Hettinger [Mon, 26 Jan 2015 00:27:40 +0000 (16:27 -0800)]
Update out-of-date comments.

10 years agoIssue #23119: Simplify setobject by inlining the special case for unicode equality...
Raymond Hettinger [Mon, 26 Jan 2015 00:12:49 +0000 (16:12 -0800)]
Issue #23119:  Simplify setobject by inlining the special case for unicode equality testing.

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

10 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.

10 years agoIssue #22286: The "backslashreplace" error handlers now works with
Serhiy Storchaka [Sun, 25 Jan 2015 20:56:57 +0000 (22:56 +0200)]
Issue #22286: The "backslashreplace" error handlers now works with
decoding and translating.

10 years agoMerge: #23215: note that time.sleep affects the current thread only.
R David Murray [Sun, 25 Jan 2015 20:47:06 +0000 (15:47 -0500)]
Merge: #23215: note that time.sleep affects the current thread only.

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

10 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.

10 years agomerge from 3.4
Senthil Kumaran [Sun, 25 Jan 2015 03:26:18 +0000 (19:26 -0800)]
merge from 3.4

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.

10 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.

10 years agoCloses #23253: Delay-load ShellExecute
Steve Dower [Sat, 24 Jan 2015 16:18:24 +0000 (08:18 -0800)]
Closes #23253: Delay-load ShellExecute

10 years agoIssue20284: Implement PEP461
Ethan Furman [Sat, 24 Jan 2015 04:05:18 +0000 (20:05 -0800)]
Issue20284: Implement PEP461

10 years agoprefer server alpn ordering over the client's
Benjamin Peterson [Fri, 23 Jan 2015 22:30:26 +0000 (17:30 -0500)]
prefer server alpn ordering over the client's

10 years agoadd support for ALPN (closes #20188)
Benjamin Peterson [Fri, 23 Jan 2015 21:35:37 +0000 (16:35 -0500)]
add support for ALPN (closes #20188)

10 years agoCloses #23305: Merged documentation fix from 3.4.
Vinay Sajip [Fri, 23 Jan 2015 21:19:53 +0000 (21:19 +0000)]
Closes #23305: Merged documentation fix from 3.4.

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

10 years agoCloses #23207: logging.basicConfig() now does additional validation of its arguments.
Vinay Sajip [Fri, 23 Jan 2015 19:54:23 +0000 (19:54 +0000)]
Closes #23207: logging.basicConfig() now does additional validation of its arguments.

10 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.

10 years agoCloses #23202: pyvenv documentation updated to match its behavior.
Vinay Sajip [Fri, 23 Jan 2015 19:36:54 +0000 (19:36 +0000)]
Closes #23202: pyvenv documentation updated to match its behavior.

10 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.

10 years agohttp.client: disable Nagle's algorithm (closes #23302)
Benjamin Peterson [Fri, 23 Jan 2015 16:02:57 +0000 (11:02 -0500)]
http.client: disable Nagle's algorithm (closes #23302)

Patch by Demian Brecht.

10 years agorevert 7b833bd1f509. I misread the side effect that the code was triggering.
Gregory P. Smith [Fri, 23 Jan 2015 06:56:06 +0000 (22:56 -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.

10 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.

10 years agoRemove the unimplemented but ignored without='-E' parameters being passed to
Gregory P. Smith [Fri, 23 Jan 2015 06:05:00 +0000 (22:05 -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)

10 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)

10 years agoOnly pass -E to the child interpreter if our interpreter was running in that
Gregory P. Smith [Fri, 23 Jan 2015 01:53:24 +0000 (17:53 -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).

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

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Thu, 22 Jan 2015 22:50:34 +0000 (23:50 +0100)]
Merge 3.4 (asyncio)

10 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.

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

10 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.

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Thu, 22 Jan 2015 21:55:31 +0000 (22:55 +0100)]
Merge 3.4 (asyncio)

10 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.

10 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

10 years agoNull merge 3.4
Victor Stinner [Thu, 22 Jan 2015 08:35:32 +0000 (09:35 +0100)]
Null merge 3.4

10 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

10 years agoMerge 3.4
Victor Stinner [Thu, 22 Jan 2015 08:09:24 +0000 (09:09 +0100)]
Merge 3.4

10 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

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Wed, 21 Jan 2015 23:18:11 +0000 (00:18 +0100)]
Merge 3.4 (asyncio)

10 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

10 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

10 years agoMerge 3.4 (asyncio)
Victor Stinner [Wed, 21 Jan 2015 22:40:19 +0000 (23:40 +0100)]
Merge 3.4 (asyncio)

10 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.

10 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

10 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.

10 years agoAdd the command line to the AssertionError raised by test.script_helper's
Gregory P. Smith [Wed, 21 Jan 2015 01:21:41 +0000 (17:21 -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. :)

10 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. :)

10 years agoMerge with 3.4 (closes #23280)
Zachary Ware [Tue, 20 Jan 2015 20:11:38 +0000 (14:11 -0600)]
Merge with 3.4 (closes #23280)