Commit Graph

89074 Commits

Author SHA1 Message Date
Serhiy Storchaka 45ec3288d0 Removed trailing whitespaces in miscalenous files. 2015-04-03 19:42:32 +03:00
Serhiy Storchaka 50ef0f41af Escaped backslashes in docstrings. 2015-04-03 18:13:23 +03:00
Victor Stinner 32ed750952 Merge 3.4 (asyncio doc) 2015-04-03 17:10:17 +02:00
Serhiy Storchaka a8cd4d482f Got rid of warnings "suggest braces around empty body in an ‘else’ statement"
in Parser/pgen.c.
2015-04-03 15:24:33 +03:00
Serhiy Storchaka 4deb950e2b Issue #22351. MockSslTests tests in test_nntplib now are reported if skipped. 2015-04-03 15:02:40 +03:00
Victor Stinner 4e3cfa46dc Issue #23853: Cleanup _ssl.c
* Rename check_socket_and_wait_for_timeout() to PySSL_select()
* PySSL_select() is now clearly splitted betwen poll() and select()
* Add empty lines for readability
2015-04-02 21:28:28 +02:00
Victor Stinner 10550cdb8a Issue #23834: Simplify timeout handling
* Use the new _PyTime_FromSeconds() function to set the timeout to -1 second
  for socket.settimeout(None). It avoids a special case in internal_select()
  because of a rounding issue: -1 nanosecond is rounded to 0 millisecond which
  means non-blocking, instead of blocking.
* Check if the interval the negative in sock_call_ex() instead of doing the
  check in internal_select(). sock_call_ex() remembers if the socket has a
  timeout or not, which avoids a race condition if the timeout is modified in a
  different thread.
2015-04-03 13:22:27 +02:00
Victor Stinner 13019fdef3 Issue #22117: Add a new _PyTime_FromSeconds() function
Fix also _Py_InitializeEx_Private(): initialize time before initializing
import, import_init() uses the _PyTime API (for thread locks).
2015-04-03 13:10:54 +02:00
Victor Stinner 21dfffa218 Merge 3.4 (test_nntplib) 2015-04-03 11:09:08 +02:00
Serhiy Storchaka f1468eb44c Issue #10590: Added tests for xml.sax.parse() and xml.sax.parseString(). 2015-04-02 23:07:19 +03:00
Serhiy Storchaka 61de087f0f Issue #2175: SAX parsers now support a character stream of InputSource object. 2015-04-02 21:00:13 +03:00
Serhiy Storchaka 278ba2690c Issue #2175: Added tests for xml.sax.saxutils.prepare_input_source().
Made test XML files non-ASCII.
2015-04-02 20:57:20 +03:00
Serhiy Storchaka b162914158 Issue #16840: Fixed test_tcl for Tcl < 8.5. 2015-04-02 20:07:24 +03:00
Serhiy Storchaka 9fe562b499 Issue #21526: Skip test_booleans on Tcl < 8.5. 2015-04-02 19:59:34 +03:00
Serhiy Storchaka 4c7dc48ea5 Issue #16840: Tkinter now supports 64-bit integers added in Tcl 8.4 and
arbitrary precision integers added in Tcl 8.5.
2015-04-02 18:49:14 +03:00
Victor Stinner ea534f79a5 (Merge 3.4) Issue #23834: Fix socket.sendto(), use the C Py_ssize_t type to
store the result of sendto() instead of the C int type.

(The bug was already fixed in the default branch, but differently.)
2015-04-02 17:20:48 +02:00
Victor Stinner 33f96f1800 Merge 3.4 (_posixsubprocess) 2015-04-02 16:25:01 +02:00
Victor Stinner a135cb8143 Issue #23618: Ooops, remove abort() added for debug purpose 2015-04-02 15:17:12 +02:00
Victor Stinner 38aec7525e Issue #23618: Fix sock_connect_impl(), set the socket error code
sock_call_ex() gets the socket error code when the socket function fails.
sock_connect_impl() didn't set the error correctly.
2015-04-02 14:37:20 +02:00
Victor Stinner 39c0721d7b Merge 3.4 (test_exceptions) 2015-04-02 14:22:44 +02:00
Victor Stinner acd8e7c1f5 Issue #23648: Complete the list of modified functions for the PEP 475 2015-04-02 13:56:29 +02:00
Victor Stinner 81c41dbfcc Issue #23618: socket.socket.connect() now waits until the connection completes
instead of raising InterruptedError if the connection is interrupted by
signals, signal handlers don't raise an exception and the socket is blocking or
has a timeout.

socket.socket.connect() still raise InterruptedError for non-blocking sockets.
2015-04-02 11:50:57 +02:00
Victor Stinner 708d9ba5a2 Issue #23618: Document EINTR changes in socket documentation 2015-04-02 11:49:42 +02:00
Victor Stinner 35bee932e4 Issue #23618: Don't declare recvmsg/sendmsg helper functions on Windows 2015-04-02 12:28:07 +02:00
Serhiy Storchaka b7616621db Issue #21526: Fixed the test_booleans test for wantobjects = 0. 2015-04-02 11:47:51 +03:00
Serhiy Storchaka b452f41cc8 Issue #21526: Fixed support of new boolean type in Tcl 8.5. 2015-04-02 10:58:40 +03:00
Serhiy Storchaka 1399a01b90 Issue #22977: Fixed formatting Windows error messages on Wine.
Patch by Martin Panter.
2015-04-02 09:50:06 +03:00
Benjamin Peterson 4b9df0d33b merge 3.4 (#23844) 2015-04-02 00:08:10 -04:00
Victor Stinner ff444e828e Issue #23834: Fix sock_call(), set deadline_initialized to recompute the timeout 2015-04-02 03:22:49 +02:00
Victor Stinner 02f32ab47e Issue #23834: Modify socket.sendall() to reuse sock_call() with
sock_send_impl()
2015-04-01 22:53:26 +02:00
Victor Stinner 31bf2d5073 Issue #23834: Add sock_call() helper function
The BEGIN_SELECT_LOOP and END_SELECT_LOOP macros of socketmodule.c don't handle
EINTR. Functions using these macros use an inner loop to handle EINTR, but they
don't recompute the timeout.

This changes replaces the two macros with a new sock_call() function which
takes a function as a parameter. sock_call() recomputes the timeout, handle
false positive and handle EINTR.
2015-04-01 21:57:09 +02:00
Victor Stinner c7489a5595 Issue #23836: Fix the faulthandler module to handle reentrant calls
to its signal handlers.

Use also _Py_write_noraise() instead of write() to retry write() if it is
interrupted by a signal (fail with EINTR).

faulthandler.dump_traceback() also calls PyErr_CheckSignals() to call the
Python signal handler if a signal was received.
2015-04-01 18:48:58 +02:00
Victor Stinner 97f86b82b7 Issue #23836: Use _Py_write_noraise() to retry on EINTR in _Py_DumpTraceback()
and _Py_DumpTracebackThreads(). Document also these functions to explain that
the caller is responsible to call PyErr_CheckSignals().
2015-04-01 18:38:01 +02:00
Victor Stinner 185fd33a17 Issue #23836: Use _Py_write_noraise() to retry on EINTR in child_exec() of
_posixsubprocess
2015-04-01 18:35:53 +02:00
Victor Stinner e72fe3995b Issue #23836: Use _Py_write_noraise() to retry on EINTR in trip_signal() of
signalmodule.c
2015-04-01 18:35:22 +02:00
Victor Stinner 6f4fae8a95 Issue #23836: Document functions releasing the GIL in fileutils.c 2015-04-01 18:34:32 +02:00
Victor Stinner 82c3e4599d Issue #23836: Add _Py_write_noraise() function
Helper to write() which retries write() if it is interrupted by a signal (fails
with EINTR).
2015-04-01 18:34:45 +02:00
Benjamin Peterson 81541f4480 merge 3.4 2015-04-01 12:37:34 -04:00
Victor Stinner 62d1c70eff Issue #22117, issue #23485: Fix _PyTime_AsMilliseconds() and
_PyTime_AsMicroseconds() rounding.

Add also unit tests.
2015-04-01 17:47:07 +02:00
Raymond Hettinger 067bbba7a4 Check deques against common sequence tests (except for slicing). 2015-04-01 08:11:09 -07:00
Victor Stinner bbe3803fb5 What's New in Python 3.5: mention signal.set_wakeup_fd() enhancement on Windows 2015-04-01 16:32:32 +02:00
Serhiy Storchaka c19c3960bb Issue #23821: Fixed test_pdb failure under -O. 2015-04-01 16:58:39 +03:00
Serhiy Storchaka 05ddbf0875 Issue #23838: linecache now clears the cache and returns an empty result on
MemoryError.
2015-04-01 16:56:13 +03:00
R David Murray ef2a397a65 It wasn't a typo, it is the mnemonic (AT=@). 2015-04-01 09:15:02 -04:00
Serhiy Storchaka c05e260ecb Issue #23799: Added test.support.start_threads() for running and cleaning up
multiple threads.
2015-04-01 13:06:18 +03:00
Victor Stinner a772662423 Issue #23618: Fix EINTR handling on Windows
Windows uses WSAEINTR error code, not EINTR, for socket functions.
2015-04-01 11:09:43 +02:00
Benjamin Peterson f8521d55ad merge 3.4 (#12855) 2015-03-31 21:21:09 -04:00
Victor Stinner 70a46f635f Issue #23618: Enhance EINTR handling in socket.connect()
Call PyErr_CheckSignals() immediatly if connect() or select() fails with EINTR
in internal_connect().

Refactor also the code to limit indentaton and make it more readable.
2015-03-31 22:03:59 +02:00
Victor Stinner ee699e9d2b Issue #23618: Fix EINTR handling in socket.connect()
Call PyErr_CheckSignals() if connect(), select() or getsockopt() failed with
EINTR.
2015-03-31 21:28:42 +02:00
Victor Stinner c4e819a54f Issue #23618: Cleanup internal_connect() in socketmodule.c
On Windows, it looks like using the C type socklen_t for getsockopt() (instead
of int) is fine, it was already used in socket.getsockopt().
2015-03-31 21:23:10 +02:00