Commit Graph

85348 Commits

Author SHA1 Message Date
Victor Stinner f2ed889027 asyncio: Use the new os.set_blocking() function of Python 3.5 if available 2014-07-29 23:08:00 +02:00
Ned Deily 3d4953a14b Edit NEWS entry 2014-07-29 13:49:11 -07:00
Ezio Melotti 8a0fb2c5ca #21704: remove duplicate name in Misc/ACKS. 2014-07-29 17:35:46 +03:00
Victor Stinner 313a980904 asyncio: sync with Tulip
* _WaitHandleFuture.cancel() now notify IocpProactor through the overlapped
  object that the wait was cancelled.
* Optimize IocpProactor.wait_for_handle() gets the result if the wait is
  signaled immediatly.
* Enhance representation of Future and Future subclasses

  - Add "created at filename:lineno" in the representation
  - Add Future._repr_info() method which can be more easily overriden than
    Future.__repr__(). It should now be more easy to enhance Future
    representation without having to modify each subclass. For example,
    _OverlappedFuture and _WaitHandleFuture get the new "created at" information.
  - Use reprlib to format Future result, and function arguments when formatting a
    callback, to limit the length of the representation.

* Fix repr(_WaitHandleFuture)
* _WaitHandleFuture and _OverlappedFuture: hide frames of internal calls in the
  source traceback.
* Cleanup ProactorIocp._poll(): set the timeout to 0 after the first call to
  GetQueuedCompletionStatus()
* test_locks: close the temporary event loop and check the condition lock
* Remove workaround in test_futures, no more needed
2014-07-29 12:58:23 +02:00
Terry Jan Reedy 7eca7343a0 Issue #17172: add NEWS 2014-07-28 22:38:19 -04:00
Terry Jan Reedy 7e55db2bc5 Issue #17172: Add the ability to run turtledemo from Idle.
Make turtledemo start as active on Mac even when run with subprocess.
Patch by Ramchandra Apt, Lita Cho, and Ned Daily.
2014-07-28 22:23:59 -04:00
Victor Stinner c61c170b41 Issue #18174: Fix leak of file descriptor in test_tempfile 2014-07-29 01:13:39 +02:00
Victor Stinner 623138c163 Issue #11453, #18174: Fix leak of file descriptor in test_asyncore 2014-07-29 01:01:09 +02:00
Victor Stinner 0970657f01 Fix sporadic failure of test_pep277 on Windows: use support.rmtree() instead of
deltree().
2014-07-29 00:40:50 +02:00
Richard Oudkerk e0e65817e5 Issue #21704: Fix build error for _multiprocessing when semaphores
are not available.  Patch by Arfrever Frehtes Taifersar Arahesis.
2014-07-28 23:01:02 +01:00
Victor Stinner 7611964b2c Fix test_bytes when sys.stdin is None, for example on Windows when using
pythonw.exe instead of python.exe
2014-07-28 22:07:07 +02:00
Victor Stinner 42d3bdeed6 asyncio, tulip issue 196: ProactorIocp._register() now registers the overlapped
in the _cache dictionary, even if we already got the result. We need to keep a
reference to the overlapped object, otherwise the memory may be reused and
GetQueuedCompletionStatus() may use random bytes and behaves badly.

There is still a hack for ConnectNamedPipe(): the overlapped object is not
register into _cache if the overlapped object completed directly.

Log also an error in debug mode in ProactorIocp._loop() if we get an unexpected
event.

Add a protection in ProactorIocp.close() to avoid blocking, even if it should
not happen. I still don't understand exactly why some the completion of some
overlapped objects are not notified.
2014-07-28 00:18:43 +02:00
Terry Jan Reedy 8b95d5e0bf Modernize turtledemo with conditional expressions; remove duplicate line. 2014-07-27 03:01:13 -04:00
Terry Jan Reedy e3416e6138 Reduce unnecessary 2.7 versus 3.4+ differences in idlelib/configDialog.py.
2009-02-02 51562 (27c589f09a21) merged Mac support revisions into 3.0.
2009-03-04 52014 (dc3d24824b60) merged slightly improved version into 2.7.
Change 3.4+ to match the later 2.7 patch.  Buttons tested manually.
2014-07-26 19:40:16 -04:00
Andrew Svetlov f200ce6333 Document lock parameter for asyncio.Condition() 2014-07-26 19:50:37 +03:00
Antoine Pitrou d2e9fdfbde Issue #22074: Fix Lib/test/make_ssl_certs.py 2014-07-26 11:15:52 -04:00
Andrew Svetlov f21fcd09c5 Accept optional lock object in Condition ctor (tulip issue #198) 2014-07-26 17:54:34 +03:00
Victor Stinner e254e53c83 Fix repr(_socket.socket) on Windows 64-bit: don't fail with OverflowError
on closed socket. repr(socket.socket) already works fine.
2014-07-26 14:36:55 +02:00
Victor Stinner 51e44ea66a Tulip issue 196: _OverlappedFuture.set_result() now clears its reference to the
overlapped object. IocpProactor._poll() now also ignores false alarms:
GetQueuedCompletionStatus() returns the overlapped but it is still pending.
2014-07-26 00:58:34 +02:00
Raymond Hettinger 5a2146a2fd Issue #22044: Fixed premature DECREF in call_tzinfo_method. 2014-07-25 14:59:48 -07:00
Victor Stinner 65dd69a3da asyncio: sync with Tulip
* Tulip issue #196: IocpProactor._poll() clears the reference to the
  overlapped operation when the operation is done. It would be better to clear
  the reference in a new _OverlappedFuture.set_result() method, but it cannot
  be done yet because of a weird bug.
* BaseSelectorEventLoop._write_to_self() now logs errors in debug mode.
2014-07-25 22:36:05 +02:00
Zachary Ware 64ba60aa57 Issue #21958: Define HAVE_ROUND when building with VS 2013 and above.
Patch by Zachary Turner.
2014-07-25 14:34:19 -05:00
Zachary Ware 88a1977a08 Issue #22072: Fix a couple of SSL doc typos. Patch by Alex Gaynor. 2014-07-25 13:30:50 -05:00
Charles-François Natali e396c363cb Merge. 2014-07-25 18:45:02 +01:00
Charles-François Natali 65708cf510 Issue #19875: Fix random test_getsockaddrarg() failure. 2014-07-25 18:44:30 +01:00
Victor Stinner 2955a0bf06 asyncio, test_subprocess: relax timings for slow builbots 2014-07-25 14:05:07 +02:00
Victor Stinner 18a28dc5c2 asyncio: sync with Tulip
* Fix _WaitHandleFuture.cancel(): return the result of the parent cancel()
  method.
* _OverlappedFuture.cancel() now clears its reference to the overlapped object.
  Make also the _OverlappedFuture.ov attribute private.
* Check if _WaitHandleFuture completed before unregistering it in the callback.
  Add also _WaitHandleFuture._poll() and repr(_WaitHandleFuture).
* _WaitHandleFuture now unregisters its wait handler if WaitForSingleObject()
  raises an exception.
* _OverlappedFuture.set_exception() now cancels the overlapped operation.
2014-07-25 13:05:20 +02:00
Serhiy Storchaka 1a901cc952 Issue #22061: Add deprecation warnings in empty obsolete methods. 2014-07-25 12:24:07 +03:00
Terry Jan Reedy 5c1b8f3de6 Issue #22061: remove call of useless function slated for removal. 2014-07-25 03:06:32 -04:00
Terry Jan Reedy 280aace067 Issue #22053: Make help work, after previous patch for this issue disabled it
by removing global 'demo'. Refactor and remove duplicate code.
2014-07-25 01:56:24 -04:00
Victor Stinner fea6a100dc asyncio: sync with Tulip
Improve stability of the proactor event loop, especially operations on
overlapped objects:

* Tulip issue 195: Don't call UnregisterWait() twice if a _WaitHandleFuture is
  cancelled twice to fix a crash.
* IocpProactor.close(): cancel futures to cancel overlapped operations, instead
  of cancelling directly overlapped operations. Future objects may not call
  ov.cancel() if the future was cancelled or if the overlapped was already
  cancelled. The cancel() method of the future may also catch exceptions. Log
  also errors on cancellation.
* tests: rename "f" to "fut"
* Add a __repr__() method to IocpProactor
* Add a destructor to IocpProactor which closes it
* _OverlappedFuture.cancel() doesn't cancel the overlapped anymore if it is
  done: if it is already cancelled or completed. Log also an error if the
  cancellation failed.
* Add the address of the overlapped object in repr(_OverlappedFuture)
* _OverlappedFuture truncates the source traceback to hide the call to the
  parent constructor (useless in debug).
2014-07-25 00:54:53 +02:00
Victor Stinner 92639cce35 Issue #19884, readline: calling rl_variable_bind ("enable-meta-key", "off")
does crash on Mac OS X which uses libedit instead of readline.
2014-07-24 22:11:38 +02:00
Victor Stinner 45cff66cf6 Issue #16133: The asynchat.async_chat.handle_read() method now ignores
BlockingIOError exceptions. Initial patch written by Xavier de Gaye.

Document also in asyncore documentation that recv() may raise BlockingIOError.
2014-07-24 18:49:36 +02:00
Victor Stinner 992019c006 Backport os.rst documentation from Python 3.5. 2014-07-24 12:42:45 +02:00
Victor Stinner 6d4f4feca2 Issue #21813: Enhance documentation of the os.stat_result class. 2014-07-24 12:42:16 +02:00
Victor Stinner a3c80ce8b7 Issue #19884: readline: Disable the meta modifier key if stdout is not a
terminal to not write the ANSI sequence "\033[1034h" into stdout. This sequence
is used on some terminal (ex: TERM=xterm-256color") to enable support of 8 bit
characters.
2014-07-24 12:23:56 +02:00
Victor Stinner cdb2c601db test_gettext: use support.rmtree() instead of shutil.rmtree() 2014-07-24 12:07:45 +02:00
Victor Stinner 0e243612f8 asyncio tests: relax timings for slow buildbots 2014-07-24 12:04:22 +02:00
Victor Stinner 5006b1fd96 Issue #20055: Fix BaseEventLoop.stop() docstring, incomplete sentence.
Patch written by Saimadhav Heblikar.
2014-07-24 11:34:11 +02:00
Andrew Svetlov ca4f34366a Fix incomplete sentence in asyncio docs. 2014-07-24 11:36:33 +03:00
Terry Jan Reedy 9ff41803af Asyncio doc fixes: spelling, grammar, duplication. 2014-07-24 02:59:02 -04:00
Terry Jan Reedy c935a9530c Englich grammar nit. 2014-07-24 02:33:14 -04:00
Benjamin Peterson 1cc9520327 s/stringobject/bytesobject/ (closes #22036)
Patch by Martin Matusiak.
2014-07-23 21:39:37 -07:00
Terry Jan Reedy 9f5388f24f Fix doc example bug reported on python-list by Akshay Verma. 2014-07-23 20:30:29 -04:00
Terry Jan Reedy b8352e7253 Issue #22053: Cleanup turtledemo start and stop and fix debug shutdown warning. 2014-07-23 17:27:57 -04:00
Zachary Ware 88b2b45154 Issue #19493: Fix two uses of ctypes.test.requires (it's not a decorator)
and skip test_win32.FunctionCallTestCase.test_SEH when Python was compiled
in debug configuration or by a non-MSC compiler.
2014-07-23 14:39:50 -05:00
Serhiy Storchaka efa9c805b1 Merge heads 2014-07-23 22:12:53 +03:00
Serhiy Storchaka 1ce2289342 Issue #6167: Backported tests for Scrollbar.activate() and Scrollbar.set()
from 6ae34a948cb4.
2014-07-23 22:08:45 +03:00
Terry Jan Reedy b03f0422c5 Issue #21597: Turtledemo text pane can now be widened to view or copy complete
lines or narrowed for small screens.
Issie #19132: Turtledemo buttons no longer disappear when window is shrun.
Patch mostly by Lita Cho (21597) using idea from patch by Jan Kanis (18132).
2014-07-23 15:01:12 -04:00
Zachary Ware f012ba42fe Issue #22002: Make full use of test discovery in test sub-packages.
Adds `load_package_tests` function to test.support, uses it in test_asyncio,
test_email, test_json, test_tools, test_importlib and all test_importlib
sub-packages to implement test discovery.
2014-07-23 12:00:29 -05:00