summaryrefslogtreecommitdiff
path: root/asyncio/unix_events.py
Commit message (Collapse)AuthorAgeFilesLines
* Fix _UnixReadPipeTransport and _UnixWritePipeTransportVictor Stinner2015-01-291-6/+11
| | | | Only start reading when connection_made() has been called.
* SSL transports now clear their reference to the waiterVictor Stinner2015-01-291-2/+2
| | | | | | | * 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.
* Close the transport on subprocess creation failureVictor Stinner2015-01-151-1/+5
|
* Python issue #23243: Fix _UnixWritePipeTransport.close()Victor Stinner2015-01-151-1/+1
| | | | | Do nothing if the transport is already closed. Before it was not possible to close the transport twice.
* UNIX pipe transports: add closed/closing in repr()Victor Stinner2015-01-141-2/+12
| | | | | Add "closed" or "closing" state in the __repr__() method of _UnixReadPipeTransport and _UnixWritePipeTransport classes.
* Remove outdated TODO/XXXVictor Stinner2015-01-091-4/+1
| | | | | | | | | | * Yes, futures errors (Error, CancelledError, TimeoutError, ...) are aliases of concurrent.futures errors * InvalidStateError: the state is already logged in the message when the exception is raised * call_exception_handler() now makes possible to decide how to handle exceptions * Add a docstring to _UnixDefaultEventLoopPolicy
* Truncate to 80 columnsVictor Stinner2015-01-091-1/+2
|
* Fix subprocess for close_fds=False on Python 3.3Victor Stinner2014-12-111-0/+22
| | | | Mark the write end of the stdin pipe as non-inheritable.
* Python issue #22922: More EventLoop methods fail if the loop is closed. InitialVictor Stinner2014-12-041-0/+1
| | | | | | | patch written by Torsten Landschoff. create_task(), call_at(), call_soon(), call_soon_threadsafe() and run_in_executor() now raise an error if the event loop is closed.
* Coroutine objects are now rejected with a TypeError by the following functions:Victor Stinner2014-11-201-2/+3
| | | | | | | | | | | | * add_signal_handler() * call_at() * call_later() * call_soon() * call_soon_threadsafe() * run_in_executor() Fix also the error message of add_signal_handler() (fix the name of the function).
* - Issue #22841: Reject coroutines in asyncio add_signal_handler().Guido van Rossum2014-11-141-0/+3
| | | | Patch by Ludovic.Gasc.
* Move loop attribute to _FlowControlMixinVictor Stinner2014-11-051-2/+1
| | | | | | | | | Move the _loop attribute from the constructor of _SelectorTransport, _ProactorBasePipeTransport and _UnixWritePipeTransport classes to the constructor of the _FlowControlMixin class. Add also an assertion to explicit that the parent class must ensure that the loop is defined (not None)
* unix_events: Move import statement to sync code with cpythonYury Selivanov2014-09-241-1/+2
|
* Tulip issue #200: Log errors in debug mode instead of simply ignoring them.Victor Stinner2014-08-251-1/+3
|
* _fatal_error() method of _UnixReadPipeTransport and _UnixWritePipeTransport nowVictor Stinner2014-07-301-2/+8
| | | | log all exceptions in debug mode
* Use the new os.set_blocking() function of Python 3.5 if availableVictor Stinner2014-07-291-4/+8
|
* signal.set_wakeup_fd() can now raise an OSError on Python 3.5Victor Stinner2014-07-221-3/+3
|
* Tulip issue 192, Python issue 21645: Rewrite signal handlingVictor Stinner2014-07-171-2/+18
| | | | | | | | | | | | | | | | | | | 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.
* Tulip issue #184: Log subprocess events in debug modeVictor Stinner2014-07-141-0/+11
| | | | | | | | | - 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
* Clean up some docstrings and comments. Remove unused unimplemented ↵Guido van Rossum2014-07-121-1/+1
| | | | _read_from_self().
* Tulip issue #183: log socket events in debug modeVictor Stinner2014-07-121-0/+36
| | | | | | | | | | - 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
* Tulip issue #181: BaseEventLoop.create_datagram_endpoint() now waits untilVictor Stinner2014-07-081-0/+2
| | | | | protocol.connection_made() has been called. Document also why transport constructors use a waiter.
* Python issue 21447, 21886: Fix a race condition when setting the result of aVictor Stinner2014-07-051-2/+2
| | | | | Future with call_soon(). Add an helper, an private method, to set the result only if the future was not cancelled.
* _UnixSubprocessTransport: fix file mode of stdinVictor Stinner2014-07-011-1/+1
| | | | Open stdin in write mode, not in read mode
* Move coroutine code in the new module asyncio.coroutinesVictor Stinner2014-06-291-4/+4
|
* Tulip issue #171: BaseEventLoop.close() now raises an exception if the eventVictor Stinner2014-06-231-1/+1
| | | | | loop is running. You must first stop the event loop and then wait until it stopped, before closing it.
* Tulip issue #83, Python issue 21252: Fill some XXX docstringsVictor Stinner2014-06-051-2/+2
|
* Close sockets on errorsVictor Stinner2014-06-041-0/+3
| | | | | | | Fix ResourceWarning: BaseEventLoop.create_connection(), BaseEventLoop.create_datagram_endpoint() and _UnixSelectorEventLoop.create_unix_server() now close the newly created socket on error.
* EventLoop.create_unix_server() now raises a ValueError if path and sock areVictor Stinner2014-04-051-0/+4
| | | | specified at the same time
* asyncio: remove unused imports and unused variables noticed by pyflakesVictor Stinner2014-02-201-1/+0
|
* Fix spelling & typosYury Selivanov2014-02-181-2/+2
|
* Issue #143: UNIX domain methods, fix ResourceWarning and DeprecationWarningVictor Stinner2014-02-191-4/+4
| | | | | warnings. create_unix_server() closes the socket on any error, not only on OSError.
* Issue #139: Improve error messages on "fatal errors"Victor Stinner2014-02-191-7/+7
| | | | | Mention if the error was caused by a read or a write, and be more specific on the object (ex: "pipe transport" instead of "transport").
* transports: Make _ProactorBasePipeTransport use _FlowControlMixinYury Selivanov2014-02-181-1/+1
|
* Add new event loop exception handling API (closes issue #80).Yury Selivanov2014-02-181-5/+21
| | | | | | | | New APIs: - loop.set_exception_handler() - loop.default_exception_handler() - loop.call_exception_handler()
* Add support for UNIX Domain Sockets. Closes issue #81.Yury Selivanov2014-02-181-2/+73
| | | | | | | | | New APIs: - loop.create_unix_connection - loop.create_unix_server - streams.open_unix_connection - streams.start_unix_server
* Issue #112: Inline make_handle() into Handle constructorVictor Stinner2014-02-101-1/+1
|
* Merge (manually) the subprocess_stream into defaultVictor Stinner2014-02-011-6/+1
| | | | | | | | | | | | | | | | | | | | | | * Add a new asyncio.subprocess module * Add new create_subprocess_exec() and create_subprocess_shell() functions * The new asyncio.subprocess.SubprocessStreamProtocol creates stream readers for stdout and stderr and a stream writer for stdin. * The new asyncio.subprocess.Process class offers an API close to the subprocess.Popen class: - pid, returncode, stdin, stdout and stderr attributes - communicate(), wait(), send_signal(), terminate() and kill() methods * Remove STDIN (0), STDOUT (1) and STDERR (2) constants from base_subprocess and unix_events, to not be confused with the symbols with the same name of subprocess and asyncio.subprocess modules * _ProactorBasePipeTransport.get_write_buffer_size() now counts also the size of the pending write * _ProactorBaseWritePipeTransport._loop_writing() may now pause the protocol if the write buffer size is greater than the high water mark (64 KB by default) * Add new subprocess examples: shell.py, subprocess_shell.py, * subprocess_attach_read_pipe.py and subprocess_attach_write_pipe.py
* Fix _UnixWritePipeTransport: raise BrokenPipeError when the pipe is closedVictor Stinner2014-01-301-1/+4
|
* Fix _make_subprocess_transport(): pass extra value to the constructorVictor Stinner2014-01-291-1/+1
|
* Add write flow control to unix pipes.Guido van Rossum2014-01-281-3/+11
|
* _fatal_error() of _UnixWritePipeTransport and _ProactorBasePipeTransport don'tVictor Stinner2014-01-281-1/+2
| | | | | | log BrokenPipeError nor ConnectionResetError Same behaviour than _SelectorTransport._fatal_error()
* Code cleanup: remove unused functionAndrew Svetlov2014-01-261-3/+0
|
* Fix race in FastChildWatcher (by its original author, Anthony Baire).Guido van Rossum2014-01-251-20/+16
|
* Strip trailing spaceVictor Stinner2014-01-251-1/+1
|
* _UnixWritePipeTransport now also supports character devices, asVictor Stinner2014-01-241-3/+5
| | | | _UnixReadPipeTransport. Patch written by Jonathan Slenders.
* Minimal pty support, by Jonathan Slenders.Guido van Rossum2014-01-101-2/+5
|
* Fix race in subprocess transport, by Victor Stinner. Fixes issue 103.Guido van Rossum2014-01-101-1/+2
|
* Set SA_RESTART to limit EINTR occurrences. (from CPython repo, by C.F. Natali.)Guido van Rossum2013-12-051-0/+2
|
* Fix from Anthony Baire for CPython issue 19566.Guido van Rossum2013-11-131-27/+41
|