]> granicus.if.org Git - python/log
python
9 years agoasyncio: BaseSelectorEventLoop uses directly the private _debug attribute
Victor Stinner [Wed, 4 Feb 2015 13:50:59 +0000 (14:50 +0100)]
asyncio: BaseSelectorEventLoop uses directly the private _debug attribute

Just try to be consistent: _debug was already used in some places, and always
used in BaseProactorEventLoop.

9 years agoFixes issue23390: make profile-opt causes -fprofile-generate and related flags
Gregory P. Smith [Wed, 4 Feb 2015 10:11:56 +0000 (02:11 -0800)]
Fixes issue23390: make profile-opt causes -fprofile-generate and related flags
to end up in distutils CFLAGS.

9 years agoSkip some tests that require a subinterpreter launched with -E or -I when the
Gregory P. Smith [Wed, 4 Feb 2015 08:59:40 +0000 (00:59 -0800)]
Skip some tests that require a subinterpreter launched with -E or -I when the
interpreter under test is being run in an environment that requires the use of
environment variables such as PYTHONHOME in order to function at all.

Adds a private test.script_helper._interpreter_requires_environment() function
to be used with @unittest.skipIf on stdlib test methods requiring this.

9 years agoasyncio, Tulip issue 221: Fix doc of QueueEmpty and QueueFull
Victor Stinner [Tue, 3 Feb 2015 14:09:24 +0000 (15:09 +0100)]
asyncio, Tulip issue 221: Fix doc of QueueEmpty and QueueFull

9 years agoIssue #23358: Add missing BaseServer entry to socketserver.__all__.
Berker Peksag [Tue, 3 Feb 2015 09:55:09 +0000 (11:55 +0200)]
Issue #23358: Add missing BaseServer entry to socketserver.__all__.

Patch by Martin Panter.

9 years agoIssue #23099: Closing io.BytesIO with exported buffer is rejected now to
Serhiy Storchaka [Tue, 3 Feb 2015 00:00:18 +0000 (02:00 +0200)]
Issue #23099: Closing io.BytesIO with exported buffer is rejected now to
prevent corrupting exported buffer.

9 years agoIssues #23363, #23364, #23365, #23366: Fixed itertools overflow tests.
Serhiy Storchaka [Mon, 2 Feb 2015 23:35:10 +0000 (01:35 +0200)]
Issues #23363, #23364, #23365, #23366: Fixed itertools overflow tests.
Used PyMem_New to check overflow.

9 years agoIssues #23363, #23364, #23365, #23366: Fixed itertools overflow tests.
Serhiy Storchaka [Mon, 2 Feb 2015 23:34:09 +0000 (01:34 +0200)]
Issues #23363, #23364, #23365, #23366: Fixed itertools overflow tests.
Used PyMem_New to check overflow.

9 years agoIssue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
Serhiy Storchaka [Mon, 2 Feb 2015 23:21:08 +0000 (01:21 +0200)]
Issue #22896: Avoid to use PyObject_AsCharBuffer(), PyObject_AsReadBuffer()
and PyObject_AsWriteBuffer().

9 years agomerge 3.3
Benjamin Peterson [Mon, 2 Feb 2015 22:47:26 +0000 (17:47 -0500)]
merge 3.3

9 years agoreduce memory usage of test (closes #23369)
Benjamin Peterson [Mon, 2 Feb 2015 22:47:07 +0000 (17:47 -0500)]
reduce memory usage of test (closes #23369)

9 years agoadjust for py3k module renaming
Benjamin Peterson [Mon, 2 Feb 2015 19:22:13 +0000 (14:22 -0500)]
adjust for py3k module renaming

9 years ago_clear_type_cache is cpython-only
Benjamin Peterson [Mon, 2 Feb 2015 19:06:11 +0000 (14:06 -0500)]
_clear_type_cache is cpython-only

9 years agoIssue #23353, asyncio: Workaround CPython bug #23353
Victor Stinner [Mon, 2 Feb 2015 17:36:31 +0000 (18:36 +0100)]
Issue #23353, asyncio: Workaround CPython bug #23353

Don't use yield/yield-from in an except block of a generator. Store the
exception and handle it outside the except block.

9 years agorevert lineno and col_offset changes from #16795 (closes #21295)
Benjamin Peterson [Mon, 2 Feb 2015 15:51:20 +0000 (10:51 -0500)]
revert lineno and col_offset changes from #16795 (closes #21295)

9 years agomerge 3.3 (#23364, #23363)
Benjamin Peterson [Mon, 2 Feb 2015 02:35:34 +0000 (21:35 -0500)]
merge 3.3 (#23364, #23363)

9 years agocheck for overflows in permutations() and product() (closes #23363, closes #23364)
Benjamin Peterson [Mon, 2 Feb 2015 02:34:07 +0000 (21:34 -0500)]
check for overflows in permutations() and product() (closes #23363, closes #23364)

9 years agomerge 3.3 (#23365)
Benjamin Peterson [Mon, 2 Feb 2015 02:11:39 +0000 (21:11 -0500)]
merge 3.3 (#23365)

9 years agocheck for overflow in combinations_with_replacement (closes #23365)
Benjamin Peterson [Mon, 2 Feb 2015 02:10:47 +0000 (21:10 -0500)]
check for overflow in combinations_with_replacement (closes #23365)

9 years agomerge 3.3 (#23366)
Benjamin Peterson [Mon, 2 Feb 2015 02:00:15 +0000 (21:00 -0500)]
merge 3.3 (#23366)

9 years agodetect overflow in combinations (closes #23366)
Benjamin Peterson [Mon, 2 Feb 2015 01:59:00 +0000 (20:59 -0500)]
detect overflow in combinations (closes #23366)

9 years agohttps goodness
Benjamin Peterson [Mon, 2 Feb 2015 01:17:22 +0000 (20:17 -0500)]
https goodness

9 years agofix tests on systems that can't validate python.org
Benjamin Peterson [Mon, 2 Feb 2015 01:16:59 +0000 (20:16 -0500)]
fix tests on systems that can't validate python.org

9 years agomerge 3.3
Benjamin Peterson [Sun, 1 Feb 2015 23:02:15 +0000 (18:02 -0500)]
merge 3.3

9 years agoremove extra ws
Benjamin Peterson [Sun, 1 Feb 2015 23:02:09 +0000 (18:02 -0500)]
remove extra ws

9 years agomerge 3.3 (#23369)
Benjamin Peterson [Sun, 1 Feb 2015 22:59:49 +0000 (17:59 -0500)]
merge 3.3 (#23369)

9 years agofix possible overflow in encode_basestring_ascii (closes #23369)
Benjamin Peterson [Sun, 1 Feb 2015 22:53:53 +0000 (17:53 -0500)]
fix possible overflow in encode_basestring_ascii (closes #23369)

9 years agoWhitespace.
Stefan Krah [Sun, 1 Feb 2015 18:46:31 +0000 (19:46 +0100)]
Whitespace.

9 years agoIssue #23352: Document that Py_buffer.suboffsets must be NULL if no suboffsets
Stefan Krah [Sun, 1 Feb 2015 18:42:12 +0000 (19:42 +0100)]
Issue #23352: Document that Py_buffer.suboffsets must be NULL if no suboffsets
are required.

9 years agoIssue #23370: Fix off-by-one error for non-contiguous buffers.
Stefan Krah [Sun, 1 Feb 2015 15:19:23 +0000 (16:19 +0100)]
Issue #23370: Fix off-by-one error for non-contiguous buffers.

9 years agoAdded a cookbook entry on logging audible messages.
Vinay Sajip [Sun, 1 Feb 2015 15:17:34 +0000 (15:17 +0000)]
Added a cookbook entry on logging audible messages.

9 years agoIssue #23212: Update Windows copy of OpenSSL to 1.0.1l
Steve Dower [Sat, 31 Jan 2015 20:19:10 +0000 (12:19 -0800)]
Issue #23212: Update Windows copy of OpenSSL to 1.0.1l

9 years agoIssue #23353: Fix the exception handling of generators in PyEval_EvalFrameEx().
Victor Stinner [Sat, 31 Jan 2015 09:29:47 +0000 (10:29 +0100)]
Issue #23353: Fix the exception handling of generators in PyEval_EvalFrameEx().
At entry, save or swap the exception state even if PyEval_EvalFrameEx() is
called with throwflag=0. At exit, the exception state is now always restored or
swapped, not only if why is WHY_YIELD or WHY_RETURN. Patch co-written with
Antoine Pitrou.

9 years agoIssue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
Serhiy Storchaka [Sat, 31 Jan 2015 09:48:52 +0000 (11:48 +0200)]
Issue #22765: Fixed test_gdb failures. Supressed unexpected gdb output.
Patch by Bohuslav Kabrda.

9 years agoFix asyncio doc typo.
R David Murray [Fri, 30 Jan 2015 00:53:33 +0000 (19:53 -0500)]
Fix asyncio doc typo.

9 years agoasyncio doc: document the new ResourceWarning warnings
Victor Stinner [Fri, 30 Jan 2015 00:35:14 +0000 (01:35 +0100)]
asyncio doc: document the new ResourceWarning warnings

9 years agoIssue #23347, asyncio: send_signal(), terminate(), kill() don't check if the
Victor Stinner [Fri, 30 Jan 2015 00:20:44 +0000 (01:20 +0100)]
Issue #23347, asyncio: send_signal(), terminate(), kill() don't check if the
transport was closed. The check broken a Tulip example and this limitation is
arbitrary. Check if _proc is None should be enough.

Enhance also close(): do nothing when called the second time.

9 years agoasyncio doc: add a section about task cancellation
Victor Stinner [Thu, 29 Jan 2015 23:55:58 +0000 (00:55 +0100)]
asyncio doc: add a section about task cancellation

9 years agoIssue #21962, asyncio doc: Suggest the usage of wait_for() to replace
Victor Stinner [Thu, 29 Jan 2015 23:37:04 +0000 (00:37 +0100)]
Issue #21962, asyncio doc: Suggest the usage of wait_for() to replace
the lack of timeout parameter for locks and queues.

9 years agoIssue #23347, asyncio: Make BaseSubprocessTransport.wait() private
Victor Stinner [Thu, 29 Jan 2015 23:16:14 +0000 (00:16 +0100)]
Issue #23347, asyncio: Make BaseSubprocessTransport.wait() private

9 years agoasyncio: Fix ResourceWarning in test_subprocess.test_proc_exit()
Victor Stinner [Thu, 29 Jan 2015 23:11:42 +0000 (00:11 +0100)]
asyncio: Fix ResourceWarning in test_subprocess.test_proc_exit()

9 years agoasyncio: sync with Tulip
Victor Stinner [Thu, 29 Jan 2015 23:05:19 +0000 (00:05 +0100)]
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.

9 years agoIssue #23243, asyncio: Emit a ResourceWarning when an event loop or a transport
Victor Stinner [Thu, 29 Jan 2015 16:50:58 +0000 (17:50 +0100)]
Issue #23243, asyncio: Emit a ResourceWarning when an event loop or a transport
is not explicitly closed. Close also explicitly transports in test_sslproto.

9 years agoIssue #22668: Remove endianness assumption in test.
Stefan Krah [Thu, 29 Jan 2015 16:33:31 +0000 (17:33 +0100)]
Issue #22668: Remove endianness assumption in test.

9 years agoIssue #22668: Ensure that format strings survive slicing after casting.
Stefan Krah [Thu, 29 Jan 2015 13:27:23 +0000 (14:27 +0100)]
Issue #22668: Ensure that format strings survive slicing after casting.

9 years agoasyncio: sync with Tulip
Victor Stinner [Thu, 29 Jan 2015 13:15:19 +0000 (14:15 +0100)]
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()

9 years agoasyncio doc: document Protocol state machine
Victor Stinner [Thu, 29 Jan 2015 12:33:15 +0000 (13:33 +0100)]
asyncio doc: document Protocol state machine

9 years agoasyncio: sync with Tulip
Victor Stinner [Thu, 29 Jan 2015 01:56:05 +0000 (02:56 +0100)]
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.

9 years agoasyncio: BaseSubprocessTransport._kill_wait() now also call close()
Victor Stinner [Thu, 29 Jan 2015 01:14:30 +0000 (02:14 +0100)]
asyncio: BaseSubprocessTransport._kill_wait() now also call close()

close() closes pipes, which is not None yet by _kill_wait().

9 years agoAlways #define _PyLong_FromDev as we always need it to compile rather than
Gregory P. Smith [Thu, 29 Jan 2015 00:07:52 +0000 (16:07 -0800)]
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?)

9 years agoasyncio: Fix _SelectorSocketTransport constructor
Victor Stinner [Wed, 28 Jan 2015 23:36:51 +0000 (00:36 +0100)]
asyncio: Fix _SelectorSocketTransport constructor

Only start reading when connection_made() has been called:
protocol.data_received() must not be called before protocol.connection_made().

9 years agoasyncio: SSL transports now clear their reference to the waiter
Victor Stinner [Wed, 28 Jan 2015 23:36:35 +0000 (00:36 +0100)]
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.

9 years agoasyncio: Fix SSLProtocol.eof_received()
Victor Stinner [Wed, 28 Jan 2015 23:35:56 +0000 (00:35 +0100)]
asyncio: Fix SSLProtocol.eof_received()

Wake-up the waiter if it is not done yet.

9 years agoUpdate setuptools to 12.0.5 and pip to 6.0.7
Donald Stufft [Wed, 28 Jan 2015 22:56:15 +0000 (17:56 -0500)]
Update setuptools to 12.0.5 and pip to 6.0.7

9 years agoFixed memory leak in marshal.
Serhiy Storchaka [Wed, 28 Jan 2015 15:10:48 +0000 (17:10 +0200)]
Fixed memory leak in marshal.

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 #23055: Fixed a buffer overflow in PyUnicode_FromFormatV. Analysis
Serhiy Storchaka [Tue, 27 Jan 2015 20:18:46 +0000 (22:18 +0200)]
Issue #23055: Fixed a buffer overflow in PyUnicode_FromFormatV.  Analysis
and fix by Guido Vranken.

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