Commit Graph

34917 Commits

Author SHA1 Message Date
Raymond Hettinger 4d58897fdb Issue 22184: Early detection and reporting of missing lru_cache parameters 2014-08-12 12:44:52 -07:00
Serhiy Storchaka 4d83192ea0 Decreased memory requirements of new tests added in issue21448. 2014-08-12 20:22:48 +03:00
Serhiy Storchaka 320a1c0ff7 Issue #21448: Fixed FeedParser feed() to avoid O(N**2) behavior when parsing long line.
Original patch by Raymond Hettinger.
2014-08-12 13:59:11 +03:00
Serhiy Storchaka 6f20170762 Issue #17923: glob() patterns ending with a slash no longer match non-dirs on
AIX.  Based on patch by Delhallt.
2014-08-12 12:55:12 +03:00
Antoine Pitrou c04d468333 Issue #20746: Fix test_pdb to run in refleak mode (-R). Patch by Xavier de Gaye. 2014-08-11 21:40:38 -04:00
Victor Stinner 6d201685e4 Close #22175: Improve test_faulthandler readability with dedent.
Patch written by Xavier de Gaye.
2014-08-10 19:50:08 +02:00
Serhiy Storchaka 4f06d604c4 Issue #22161: Conformed arguments type checks in ctype to actually supported
types.  Corrected error messages about bytes arguments.
2014-08-09 09:33:05 +03:00
Terry Jan Reedy da26cca1ce Issue #14105: Stop removing breakpoints from Idle editors.
Move BREAK tag configuration to PyShellEditorWindow.
2014-08-08 23:33:16 -04:00
Zachary Ware 5a794c16d9 Issue #22060: Clean up/simplify test_ctypes, use test discovery 2014-08-08 13:32:16 -05:00
Serhiy Storchaka 41ad77c697 Issue #20056: Fixed deprecation warning about bytes path in test_shutil on
Windows.  Path by Vajrasky Kok.
2014-08-07 19:38:37 +03:00
Ezio Melotti 1241c47aa2 #22092: use absolute imports in unittest tests. Patch by Vajrasky Kok. 2014-08-07 03:20:22 +03:00
Ezio Melotti 12b7f48216 #11955: show the list of args in case of error in test_argparse. 2014-08-05 02:24:03 +03:00
Zachary Ware 69fb6a41c5 Issue #22104: Don't hold a reference to the loaded TestSuite in runtest_inner 2014-08-04 11:15:10 -05:00
Ezio Melotti d577480197 #20977: fix undefined name in the email module. Patch by Rose Ames. 2014-08-04 17:16:49 +03:00
Terry Jan Reedy 4036d87f4d PEP 8 spacing in idlelib.configDialog: mostly a = b in assignments,
a, b in arg lists, and hanging indents for long arg lists.
2014-08-03 23:02:58 -04:00
Terry Jan Reedy 2240533b9f Issue #22068: Don't create self reference cycles in idlelib.ConfigDialog. 2014-07-30 19:24:32 -04:00
Serhiy Storchaka 74596a887a Issue #21580: Now Tkinter correctly handles bytes arguments passed to Tk.
In particular this allows to initialize images from binary data.
2014-07-30 18:33:13 +03:00
Serhiy Storchaka 95a9e0bf8c Issue #21951: Temporary skip crashing test_user_command on AIX. 2014-07-30 10:59:46 +03:00
Victor Stinner 9c9f1f10d3 Close #22063: socket operations (socket,recv, sock_sendall, sock_connect,
sock_accept) now raise an exception in debug mode if sockets are in blocking
mode.
2014-07-29 23:08:17 +02:00
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
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 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
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
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
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 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 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
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
Victor Stinner c4c464911a asyncio: sync with Tulip
* Tulip issue 194: Don't use sys.getrefcount() in unit tests
* signal.set_wakeup_fd() can now raise an OSError on Python 3.5
2014-07-23 18:21:45 +02:00
Serhiy Storchaka 8966759b03 Issue #21888: plistlib's load() and loads() now work if the fmt parameter is
specified.
2014-07-23 18:49:31 +03:00
Charles-François Natali 889d6463b3 Issue #21901: Cap the maximum number of file descriptors to use for the test. 2014-07-22 21:25:03 +01:00
Victor Stinner 31e7bfa6ba asyncio, tulip issue 193: Convert StreamWriter.drain() to a classic coroutine
Replace also _make_drain_waiter() function with a classic _drain_helper()
coroutine.
2014-07-22 12:03:40 +02:00
Serhiy Storchaka 1392df96ef Fixed bugs in reprs of CookieJar and multiprocessing.dummy.Value. 2014-07-22 11:09:36 +03:00
Senthil Kumaran bc07ac5180 Fix localhost checking in FileHandler. Raised in #21970. 2014-07-22 00:15:20 -07:00
Antoine Pitrou dfab935c74 Issue #21976: Fix test_ssl to accept LibreSSL version strings.
Thanks to William Orr.
2014-07-21 18:35:01 -04:00
Victor Stinner 47ae763d28 Issue #19629: Add missing "import stat"
Sort also imports in support/__init__.py
2014-07-21 21:40:19 +02:00
Victor Stinner ec86469ca3 Issue #19811, #22022: test_pathlib uses support.rmtree() instead of
shutil.rmtree() to remove the temporary directory.
2014-07-21 19:19:05 +02:00
Victor Stinner 67f8706521 Issue #19629: Fix support.rmtree(), use os.lstat() to check if the file is a
directory, not os.path.isdir()
2014-07-21 19:18:12 +02:00
Victor Stinner 0dee8ad579 asyncio: Fix test_stdin_broken_pipe(), drain() is not a coroutine 2014-07-21 16:23:33 +02:00
Raymond Hettinger 854e76effa Issue #21868: Prevent turtle crash due to invalid undo buffer size. 2014-07-20 21:30:32 -07:00
Victor Stinner be0a2d767c Fix asyncio.__all__: export also unix_events and windows_events symbols
For example, on Windows, it was not possible to get ProactorEventLoop or
DefaultEventLoopPolicy using "from asyncio import *".
2014-07-18 12:44:25 +02:00
Victor Stinner 98fa332e33 Issue #21247: Fix a race condition in test_send_signal() of asyncio
Add a basic synchronization mechanism to wait until the child process is ready
before sending it a signal.
2014-07-17 23:49:11 +02:00
Victor Stinner fe5649c7b7 Python issue #21645, Tulip issue 192: Rewrite signal handling
Since Python 3.3, the C signal handler writes the signal number into the wakeup
file descriptor and then schedules the Python call using Py_AddPendingCall().

asyncio uses the wakeup file descriptor to wake up the event loop, and relies
on Py_AddPendingCall() to schedule the final callback with call_soon().

If the C signal handler is called in a thread different than the thread of the
event loop, the loop is awaken but Py_AddPendingCall() was not called yet. In
this case, the event loop has nothing to do and go to sleep again.
Py_AddPendingCall() is called while the event loop is sleeping again and so the
final callback is not scheduled immediatly.

This patch changes how asyncio handles signals. Instead of relying on
Py_AddPendingCall() and the wakeup file descriptor, asyncio now only relies on
the wakeup file descriptor. asyncio reads signal numbers from the wakeup file
descriptor to call its signal handler.
2014-07-17 22:43:40 +02:00
Victor Stinner ddc8c8db1c asyncio: Fix test_stdin_broken_pipe(), drain() can also raise
ConnectionResetError
2014-07-17 14:01:14 +02:00
Victor Stinner d55b54d5c0 asyncio, tulip issue 190: Process.communicate() now ignores
ConnectionResetError too
2014-07-17 13:12:03 +02:00
Victor Stinner cc996b5789 asyncio, tulip issue 190: Process.communicate() must ignore BrokenPipeError
If you want to handle the BrokenPipeError, you can easily reimplement
communicate().

Add also a unit test to ensure that stdin.write() + stdin.drain() raises
BrokenPipeError.
2014-07-17 12:25:27 +02:00
Serhiy Storchaka 2c6a3aedeb Issue 21044: tarfile.open() now handles fileobj with an integer 'name'
attribute.  Based on patch by Martin Panter.
2014-07-16 23:58:58 +03:00
Zachary Ware 2b0a610297 Issue #21918: Convert test_tools.py to a sub-package of test. 2014-07-16 14:26:09 -05:00
Victor Stinner accef5ce36 asyncio: test_as_completed(): disable "slow callback" warning 2014-07-16 18:54:13 +02:00
Victor Stinner e931f7b768 Issue #21163: Fix "destroy pending task" warning in test_wait_errors() 2014-07-16 18:50:39 +02:00
Victor Stinner f03b3c7564 Issue #21163, asyncio: Ignore "destroy pending task" warnings for private tasks
in gather().
2014-07-16 18:36:24 +02:00
Victor Stinner 1314f06293 asyncio: test_selector_events: remove duplicate call to _on_handshake() method
The _SelectorSslTransport constructor already calls it.
2014-07-16 18:02:10 +02:00
Tal Einat 9b7f9e6c5a Issue #21765: Add support for non-ascii identifiers to HyperParser 2014-07-16 16:33:36 +03:00
Terry Jan Reedy cfa8950aab Issue #21982: Add minimal unittest for configDialog with 46% coverage.
Fix regression that this test would have caught.
2014-07-14 23:07:32 -04:00
Victor Stinner 1cae9ec966 asyncio tests: make quiet the logs of SSL handshake failures when running tests
in debug mode
2014-07-14 22:26:34 +02:00
Victor Stinner acdb782a83 asyncio: sync with Tulip
* Tulip issue #184: Log subprocess events in debug mode

  - Log stdin, stdout and stderr transports and protocols
  - Log process identifier (pid)
  - Log connection of pipes
  - Log process exit
  - Log Process.communicate() tasks: feed stdin, read stdout and stderr
  - Add __repr__() method to many classes related to subprocesses


* Add BaseSubprocessTransport._pid attribute. Store the pid so it is still
  accessible after the process exited. It's more convinient for debug.

* create_connection(): add the socket in the "connected to" debug log

* Clean up some docstrings and comments. Remove unused unimplemented
  _read_from_self().
2014-07-14 18:33:40 +02:00
Terry Jan Reedy 5283c4e108 Issue #18592: Method return signature changes made to SearchDialogBase for
test purposes are now reflected in GrepDialog and ReplaceDialog.  Docstrings
are improved. Initial patch by Saimadhav Heblikar
2014-07-13 17:27:26 -04:00
Ned Deily 5d0d2e6ed6 Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:16:56 -07:00
Ned Deily 217f4cd7ee Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:12:39 -07:00
Ned Deily 915a30fb0d Issue #21323: Fix http.server to again handle scripts in CGI subdirectories,
broken by the fix for security issue #19435.  Patch by Zach Byrne.
2014-07-12 22:06:26 -07:00
Berker Peksag ad5ffd4767 Issue #19076: Don't pass the redundant 'file' argument to self.error(). 2014-07-12 18:24:32 +03:00
Victor Stinner e912e652f8 asyncio: sync with Tulip
* Tulip issue #183: log socket events in debug mode

  - Log most important socket events: socket connected, new client, connection
    reset or closed by peer (EOF), etc.
  - Log time elapsed in DNS resolution (getaddrinfo)
  - Log pause/resume reading
  - Log time of SSL handshake
  - Log SSL handshake errors
  - Add a __repr__() method to many classes

* Fix ProactorEventLoop() in debug mode. ProactorEventLoop._make_self_pipe()
  doesn't call call_soon() directly because it checks for the current loop
  which fails, because the method is called to build the event loop.

* Cleanup _ProactorReadPipeTransport constructor. Not need to set again
  _read_fut attribute to None, it is already done in the base class.
2014-07-12 03:11:53 +02:00
Victor Stinner 8ebeb03740 asyncio: improve the documentation of servers
- Fix the documentation of Server.close(): it closes sockets
- Replace AbstractServer with Server
- Document Server.sockets attribute
2014-07-11 23:47:40 +02:00
Victor Stinner b28dbac86d asyncio, Tulip issue 180: Make Server attributes and methods private
- loop, waiters and active_count attributes are now private
- attach(), detach() and wakeup() methods are now private

The sockets attribute remains public.
2014-07-11 22:52:21 +02:00
Berker Peksag 7aee3ecd57 Issue #21906: Make Tools/scripts/md5sum.py work in Python 3.
Patch by Zachary Ware.
2014-07-11 20:42:18 +03:00
Victor Stinner 770e48d017 asyncio: sync with Tulip
* Tulip issue #182: Improve logs of BaseEventLoop._run_once()

  - Don't log non-blocking poll
  - Only log polling with a timeout if it gets events or if it timed out after
    more than 1 second.

* Fix some pyflakes warnings: remove unused imports
2014-07-11 11:58:33 +02:00
Terry Jan Reedy 3740d589f7 Issue #18592: Make unittest for SearchDialogBase work on all tk versions. 2014-07-11 00:37:14 -04:00
Terry Jan Reedy 223dd8d7d2 #21940: Add unittest for WidgetRedirector. Initial patch by Saimadhav Heblikar. 2014-07-11 00:16:00 -04:00
Victor Stinner 737c34fa85 asyncio: sync with Tulip
- CoroWrapper.__del__() now reuses repr(CoroWrapper) to log the "... was never
  yielded from" warning
- Improve CoroWrapper: copy also the qualified name on Python 3.4, not only on
  Python 3.5+
2014-07-11 01:04:16 +02:00
Victor Stinner c39ba7d611 asyncio: sync with Tulip
- repr(Task) and repr(CoroWrapper) now also includes where these objects were
  created. If the coroutine is not a generator (don't use "yield from"), use
  the location of the function, not the location of the coro() wrapper.
- Fix create_task(): truncate the traceback to hide the call to create_task().
2014-07-11 00:21:27 +02:00
Victor Stinner f68bd88aa6 asyncio: sync with Tulip
- Issues #21936, #21163: Fix sporadic failures of
  test_future_exception_never_retrieved()
- Handle.cancel() now clears references to callback and args
- In debug mode, repr(Handle) now contains the location where the Handle was
  created.
2014-07-10 22:32:58 +02:00
Zachary Ware eb43214427 Issue #21942: Fixed source file viewing in pydoc's server mode on Windows. 2014-07-10 11:18:00 -05:00
Terry Jan Reedy 7cca28ffa2 Issue #21940: add docstrings to idlelib.WidgetRedirector. 2014-07-10 01:16:49 -04:00
Berker Peksag 740c730086 Issues #21948 and #16040: Fix typos. 2014-07-09 20:15:28 +03:00
Victor Stinner bfff45d611 asyncion, Tulip issue 181: BaseEventLoop.create_datagram_endpoint() now waits
until protocol.connection_made() has been called. Document also why transport
constructors use a waiter.
2014-07-08 23:57:31 +02:00
Victor Stinner 896a25ab30 asyncio: sync with Tulip
- Tulip issue 185: Add a create_task() method to event loops. The create_task()
  method can be overriden in custom event loop to implement their own task
  class. For example, greenio and Pulsar projects use their own task class. The
  create_task() method is now preferred over creating directly task using the
  Task class.
- tests: fix a warning
- fix typo in the name of a test function
- Update AbstractEventLoop: add new event loop methods; update also the unit test
2014-07-08 11:29:25 +02:00
Victor Stinner 630a4f63c5 Issue #11259: asynchat.async_chat().set_terminator() now raises a ValueError if
the number of received bytes is negative.
2014-07-08 00:26:36 +02:00
Victor Stinner fd5d1b51d6 asynchat: PEP8-ify the code 2014-07-08 00:16:54 +02:00
Victor Stinner d9e810a870 Issue #12523: asynchat.async_chat.push() now raises a TypeError if it doesn't
get a bytes string
2014-07-08 00:00:30 +02:00
Berker Peksag a90afbc7ee Issue #21707: Fix tests on Windows. 2014-07-07 21:29:50 +03:00
Victor Stinner 799a60ccb4 asyncio: sync with Tulip
Backout the "Tulip issue 181: Faster create_connection()" changeset, it was a
mistake.
2014-07-07 18:08:22 +02:00
Victor Stinner 1a870c9132 asyncio: sync with Tulip
- Tulip issue #181: Faster create_connection(). Call directly
  waiter.set_result() in the constructor of _ProactorBasePipeTransport and
  _SelectorSocketTransport, instead of using of delaying the call with
  call_soon().
- Cleanup iscoroutine()
2014-07-07 17:26:54 +02:00
Serhiy Storchaka 11116da935 Merge heads 2014-07-07 15:18:22 +03:00
Berker Peksag 0a0d1da987 Issue #21707: Add missing kwonlyargcount argument to ModuleFinder.replace_paths_in_code(). 2014-07-07 14:58:12 +03:00
Serhiy Storchaka 6f1435c939 Issue #21881: Just omit tests for platform-specific NaN representation in test_tcl. 2014-07-07 14:57:08 +03:00
Serhiy Storchaka 344f8316fd Issue #19593: Use specific asserts in importlib tests. 2014-07-07 14:08:19 +03:00
Serhiy Storchaka 3bc13cc8b0 Merge heads 2014-07-07 13:46:09 +03:00
Serhiy Storchaka 667abc7d42 Issue #21881: Be more tolerant in test_tcl to not parsable by float() NaN
representations (on mips and m68k platforms).
2014-07-07 13:44:33 +03:00
Antoine Pitrou e50dafcd63 Issue #20639: calling Path.with_suffix('') allows removing the suffix again.
Patch by July Tikhonov.
2014-07-06 21:37:15 -04:00
Antoine Pitrou 7084e736db Issue #21714: Disallow the construction of invalid paths using Path.with_name(). Original patch by Antony Lee. 2014-07-06 21:31:12 -04:00
Ned Deily 7bc5fb6916 Issue #21923: Prevent AttributeError in distutils.sysconfig.customize_compiler
due to possible uninitialized _config_vars.  Original patch by Alex Gaynor.
2014-07-06 16:14:33 -07:00
Victor Stinner a9acbe82e7 Closes #21886, #21447: Fix a race condition in asyncio when setting the result
of a Future with call_soon(). Add an helper, a private method, to set the
result only if the future was not cancelled.
2014-07-05 15:29:41 +02:00
Antoine Pitrou acc8cf2cfa Issue #21897: Fix a crash with the f_locals attribute with closure variables when frame.clear() has been called. 2014-07-04 20:24:13 -04:00
Zachary Ware ad4690fcca Issue #21151: Fixed a segfault in the winreg module.
When ``None`` was passed as a ``REG_BINARY`` value to SetValueEx,
PyMem_DEL was called on an uninitialized buffer.  Patch by John Ehresman.

(Also an incidental typo fix in a comment in test_winreg)
2014-07-03 10:58:06 -05:00
Raymond Hettinger 11cda47661 Fix guidance for subclassing collections.Set() 2014-07-03 00:31:30 +01:00
Victor Stinner 2dba23af71 asyncio: sync with Tulip
* _UnixSubprocessTransport: fix file mode of stdin. Open stdin in write mode,
  not in read mode
* Examples: close the event loop at exit
* More reliable CoroWrapper.__del__. If the constructor is interrupted by
  KeyboardInterrupt or the coroutine objet is destroyed lately, some the
  _source_traceback attribute doesn't exist anymore.
* repr(Task): include also the future the task is waiting for
2014-07-03 00:59:00 +02:00
Terry Jan Reedy 092b3cf671 More idlelib cleanup inspired by pyflakes. 2014-07-01 21:33:31 -04:00
Zachary Ware d9de794c23 Issue #18258: Fix test discovery for test_codecmaps_*. 2014-07-01 19:55:04 -05:00
Terry Jan Reedy 44f09ebd0f Delete a few unused names suggested by pyflakes. 2014-07-01 18:52:37 -04:00
Victor Stinner 1690ed397a asyncio: Fix test_sleep_cancel(): call_later() mock has no self parameter 2014-07-01 12:38:51 +02:00
Terry Jan Reedy 8cefd08943 Issue #18592: Refactor 2 SearchDialogBase.create_(option/other)_buttons methods
to remove duplication and return info for tests.  Rewrite corresponding tests.
Test_create_option_buttons was not testing anything because of buggy
comparisons.  Use Python subscripting to get widget options.
2014-06-30 23:52:20 -04:00
Terry Jan Reedy 525168bd74 Issue #18592: Add unittests for SearchDialogBase. Patch by Phil Webster. 2014-06-30 20:00:03 -04:00
Terry Jan Reedy f5ac57dc05 Issue #21882: In turtle demos, remove module scope gui and sys calls by
either deleting or moving to the module's main function.
2014-06-30 16:09:24 -04:00
Victor Stinner 98b6391fd4 Issue #21163: BaseEventLoop.run_until_complete() and test_utils.run_briefly()
don't log the "destroy pending task" message anymore. The log is redundant for
run_until_complete() and useless in run_briefly().
2014-06-30 14:51:04 +02:00
Victor Stinner b75380f333 asyncio: sync with Tulip
- Sort imports
- Simplify/optimize iscoroutine(). Inline inspect.isgenerator(obj): replace it
  with isinstance(obj, types.GeneratorType)
- CoroWrapper: check at runtime if Python has the yield-from bug #21209.  If
  Python has the bug, check if CoroWrapper.send() was called by yield-from to
  decide if parameters must be unpacked or not.
- Fix "Task was destroyed but it is pending!" warning in
  test_task_source_traceback()
2014-06-30 14:39:11 +02:00
Berker Peksag 67ef591045 Issue #14235: Use importlib.reload() in test_cmd.test_coverage. 2014-06-30 04:04:52 +03:00
Berker Peksag ad324f6bcc Issue #20753: Skip PasswordProtectedSiteTestCase when Python is built without threads. 2014-06-29 15:54:56 +03:00
Victor Stinner f951d28ac8 asyncio: sync with Tulip, add a new asyncio.coroutines module 2014-06-29 00:46:45 +02:00
Jesus Cea 61f32cb5b8 Closes #11279: test_posix and lack of "id -G" support - less noise required? (Solaris) 2014-06-28 18:39:35 +02:00
Victor Stinner 09e7590801 asyncio: Fix two "Coroutine xxx was never yielded from" messages in tests 2014-06-28 01:19:11 +02:00
Victor Stinner b9a301a348 asyncio: Fix unit tests on Windows, escape filenames in regex 2014-06-28 00:12:02 +02:00
Victor Stinner 4d4c69dc35 Issue #11453: asyncore: emit a ResourceWarning when an unclosed file_wrapper
object is destroyed. The destructor now closes the file if needed. The close()
method can now be called twice: the second call does nothing.
2014-06-27 23:52:03 +02:00
Victor Stinner 252d40ef1e Closes #21582: Cleanup test_asyncore. Patch written by diana.
- Use support.captured_stderr() where appropriate
- Removes some "from test.support import xxx" import and uses support.xxx
  instead.
2014-06-27 22:44:40 +02:00
Victor Stinner 80f53aa9a0 asyncio, Tulip issue 137: In debug mode, save traceback where Future, Task and
Handle objects are created. Pass the traceback to call_exception_handler() in
the 'source_traceback' key.

The traceback is truncated to hide internal calls in asyncio, show only the
traceback from user code.

Add tests for the new source_traceback, and a test for the 'Future/Task
exception was never retrieved' log.
2014-06-27 13:52:20 +02:00
Victor Stinner bbd96c6f47 asyncio, Tulip issue 137: In debug mode, add the traceback where the coroutine
object was created to the "coroutine ... was never yield from" log
2014-06-27 12:28:41 +02:00
Victor Stinner c4cca45baf asyncio: Oops, restore a removed test 2014-06-27 12:23:41 +02:00
Ned Deily 5c867018f0 Issue #21875: Remove vestigial references to Classic Mac OS in os module docs. 2014-06-26 23:40:06 -07:00
Zachary Ware 7180c793c4 Issue #21829: Fix running test_ctypes on Windows with -O or -OO 2014-06-26 15:20:44 -05:00
R David Murray c6772c4d59 #21476: Unwrap fp in BytesParser so the file isn't unexpectedly closed.
This makes the behavior match that of Parser.  Patch by Vajrasky Kok.
2014-06-26 13:31:43 -04:00
Terry Jan Reedy ede05736cf Issue #18592: For idlelib.SearchDialogBase, edit and add docstrings,
move two functions next to the functions that use them.
2014-06-26 01:40:51 -04:00
Victor Stinner 17b53f1301 asyncio: Handle error handler: enhance formatting of the callback 2014-06-26 01:35:45 +02:00
Victor Stinner 72502c12a7 Issue #21163: Fix one more "Task was destroyed but it is pending!" log in tests 2014-06-25 23:57:50 +02:00
Victor Stinner 7ba4061098 asyncio: sync with Tulip
- Python issue 21163: Fix more "Task was destroyed but it is pending!" logs in
  tests
- Add test to check that run_until_complete() checks the loop of the future
2014-06-25 23:32:25 +02:00
Victor Stinner 87f16f892c Issue #21163, asyncio: Fix some "Task was destroyed but it is pending!" logs in tests 2014-06-25 23:11:21 +02:00