Commit Graph

8810 Commits

Author SHA1 Message Date
Serhiy Storchaka cb98556373 Issue #20159. Converted the _elementtree module to Argument Clinic. 2015-05-04 15:32:48 +03:00
Larry Hastings 2d0a69a456 Fix Windows build breakage from checkins on Issues #20148 and #20168. 2015-05-03 14:49:19 -07:00
Serhiy Storchaka 4b7b82f133 Issue #20179: Converted the _ssl module to Argument Clinic. 2015-05-03 16:14:08 +03:00
Serhiy Storchaka a860aeaf98 Issue #20148: Converted the _sre module to Argument Clinic. 2015-05-03 15:54:23 +03:00
Serhiy Storchaka 5abdf48430 Issue #20168: Converted the _tkinter module to Argument Clinic. 2015-05-03 15:49:47 +03:00
Benjamin Peterson 88abdef02b merge 3.4 (#24094) 2015-05-02 22:37:13 -04:00
Benjamin Peterson 122f4b1bda merge 3.3 (#24094) 2015-05-02 22:36:26 -04:00
Benjamin Peterson 501182a47b just sort the items tuple directly (closes #24094) 2015-05-02 22:28:04 -04:00
Raymond Hettinger c6249a6268 Defer deleted item decref until after the deque is restored to a consistent state. 2015-05-02 10:44:17 -07:00
Raymond Hettinger 1dd8e71eb3 Issues #24099, #24100, and #24101: Fix free-after-use bug in heapq. 2015-05-02 10:00:22 -07:00
Benjamin Peterson 1dfd247c1b remove the concept of an unoptimized function scope from the compiler, since it can't happen anymore 2015-04-27 21:44:22 -04:00
Benjamin Peterson fc9d6f600e merge 3.4 (#24058) 2015-04-26 15:56:23 -04:00
Benjamin Peterson 0c6a5d1deb remove extern definition, since it's in a header file (closes #24058) 2015-04-26 15:55:06 -04:00
Gregory P. Smith 9afe8a3306 Fix computation of max_fd on OpenBSD. Issue #23852. 2015-04-25 23:44:02 -07:00
Gregory P. Smith f9681776c9 Fix computation of max_fd on OpenBSD. Issue #23852. 2015-04-25 23:43:34 -07:00
Gregory P. Smith 9c6b916662 Switch binascii over to using the common _Py_strhex implementation for its hex
and hexlify functions.  issue9951.
2015-04-26 00:42:13 +00:00
Gregory P. Smith 4dff6f6fa6 Issue9951: update _hashopenssl and md5module to use _Py_strhex().
Also update _posixsubprocess to use Py_hexdigits instead of its own constant.
2015-04-25 23:42:38 +00:00
Gregory P. Smith 8cb6569fe1 Implements issue #9951: Adds a hex() method to bytes, bytearray, & memoryview.
Also updates a few internal implementations of the same thing to use the
new built-in code.

Contributed by Arnon Yaari.
2015-04-25 23:22:26 +00:00
Victor Stinner cc0bbbc781 (Merge 3.4) Issue #9246: On POSIX, os.getcwd() now supports paths longer than
1025 bytes. Patch written by William Orr.
2015-04-25 00:21:52 +02:00
Victor Stinner 4403d7def0 Issue #9246: On POSIX, os.getcwd() now supports paths longer than 1025 bytes
Patch written by William Orr.
2015-04-25 00:16:10 +02:00
Serhiy Storchaka 247789cee9 Issue #24007: Argument Clinic now writes the format of PyArg_Parse*() at the
same line as function name.
2015-04-24 00:40:51 +03:00
Serhiy Storchaka 71b49dde3a Issue #16840. Turn off bignum support in tkinter with with Tcl earlier than 8.5.8
(tclTomMath.h was broken) and non-final Tcl 8.6.
Removed TK_VERSION_HEX.
2015-04-22 10:59:32 +03:00
Serhiy Storchaka 3af7a38c61 Issue #16840. Turn off bignum support in tkinter with with Tcl earlier than 8.5.8
(tclTomMath.h was broken) and non-final Tcl 8.6.
2015-04-22 10:53:08 +03:00
Christian Heimes 8714cfdc4a Get rid of unused-but-set-variable warning. len and len2 should be equal and len2 is technically more correct, too. 2015-04-21 10:57:41 +02:00
Serhiy Storchaka 629d697f96 Issue #16840: Turn on support of bignums only in final release of Tcl 8.5. 2015-04-20 14:07:41 +03:00
Serhiy Storchaka 77e8311deb Issue #16840: Turn on support of bignums only in final release of Tcl 8.5. 2015-04-20 14:05:37 +03:00
Serhiy Storchaka 7e9d1d1a1b Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncate them.

Removed no longer used _PyUnicode_HasNULChars().
2015-04-20 10:12:28 +03:00
Serhiy Storchaka 2b0d2007a1 Issue #23908: os functions now reject paths with embedded null character
on Windows instead of silently truncate them.
2015-04-20 09:53:58 +03:00
Serhiy Storchaka e3037e1145 Issue #23728: binascii.crc_hqx() could return an integer outside of the range
0-0xffff for empty data.
2015-04-20 09:31:51 +03:00
Serhiy Storchaka 2ef7c47844 Issue #23728: binascii.crc_hqx() could return an integer outside of the range
0-0xffff for empty data.
2015-04-20 09:26:49 +03:00
Serhiy Storchaka bb72c47996 Use PyArg_ParseTuple (new API) instead of PyArg_Parse (old API) for parsing tuples. 2015-04-19 20:38:19 +03:00
Serhiy Storchaka 6359641bcd Issue #20181: Converted the unicodedata module to Argument Clinic. 2015-04-17 21:18:49 +03:00
Serhiy Storchaka 9260e77386 Issue #20184: Converted _dbm and _gdbm modules to Argument Clinic. 2015-04-17 21:05:18 +03:00
Christian Heimes 29fbd21d73 Remove redundant check fro md5module.
CID 1294331 (#1 of 1): Identical code for different branches (IDENTICAL_BRANCHES)
2015-04-16 17:29:11 +02:00
Christian Heimes 82adeffc13 Fix typo in assert statement 2015-04-16 17:21:54 +02:00
Serhiy Storchaka f24131ff31 Issue #20175: Converted the _io module to Argument Clinic. 2015-04-16 11:19:43 +03:00
Larry Hastings 7f90cba7f3 Issue #23935: Argument Clinic's understanding of format units
accepting bytes, bytearrays, and buffers is now consistent with
both the documentation and the implementation.
2015-04-15 23:02:12 -04:00
Steve Dower d2bc389e55 Issue #4254: Adds _curses.update_lines_cols() Patch by Arnon Yaari 2015-04-15 18:06:05 -04:00
Larry Hastings 89964c48d1 Issue #23944: Argument Clinic now wraps long impl prototypes at column 78. 2015-04-14 18:07:59 -04:00
Berker Peksag dfa4e045a3 Issue #23943: Fix typos. Patch by Piotr Kasprzyk. 2015-04-14 09:35:51 +03:00
Berker Peksag 4882cacab6 Issue #23943: Fix typos. Patch by Piotr Kasprzyk. 2015-04-14 09:30:01 +03:00
Zachary Ware 8ef887ce47 Issue #20586: Argument Clinic now ensures signatures on functions without docstrings. 2015-04-13 18:22:35 -05:00
Larry Hastings a6cc551502 Issue #22631: Added Linux-specific socket constant CAN_RAW_FD_FRAMES.
Patch courtesy of Joe Jevnik.
2015-04-13 17:48:40 -04:00
doko@ubuntu.com 4b761bf79a - merge 3.4 2015-04-13 22:00:30 +02:00
doko@ubuntu.com 1345d20193 - Use PLATDIR for the platform directory everywhere (refactoring only) 2015-04-13 21:59:57 +02:00
Brett Cannon f299abdafa Issue #23731: Implement PEP 488.
The concept of .pyo files no longer exists. Now .pyc files have an
optional `opt-` tag which specifies if any extra optimizations beyond
the peepholer were applied.
2015-04-13 14:21:02 -04:00
Antoine Pitrou 56452eea39 Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file. 2015-04-13 20:02:33 +02:00
Antoine Pitrou 85e3ee749c Issue #22982: Improve BOM handling when seeking to multiple positions of a writable text file. 2015-04-13 20:01:21 +02:00
Antoine Pitrou 0f164c606a Merge 2015-04-13 19:49:04 +02:00
Antoine Pitrou 20d31b5182 Merge 2015-04-13 19:48:52 +02:00
Antoine Pitrou cb46f0ecb0 Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr).  A fatal
error is emitted instead.
2015-04-13 19:48:19 +02:00
Antoine Pitrou 25f85d4bd5 Issue #23309: Avoid a deadlock at shutdown if a daemon thread is aborted
while it is holding a lock to a buffered I/O object, and the main thread
tries to use the same I/O object (typically stdout or stderr).  A fatal
error is emitted instead.
2015-04-13 19:41:47 +02:00
Zachary Ware 774ac377da Closes #17202: Merge with 3.4 2015-04-13 12:11:40 -05:00
Zachary Ware 4c9c848159 Issue #17202: Add .bat to .hgeol to force them to CRLF.
Using LF can a script to fail if it tries to use a label that is
split across 512 byte blocks.  Who knows why.
2015-04-13 11:59:54 -05:00
Benjamin Peterson 5646de47e1 make DirEntryType and ScandirIteratorType static (closes #23918) 2015-04-12 17:56:34 -04:00
Steve Dower f737703671 Issue #23668: Regenerates posixmodule.c.h for new ifdefs 2015-04-12 15:44:54 -04:00
Steve Dower a1c7e727c8 Issue #23668: Suppresses invalid parameter handler around chsize calls. 2015-04-12 00:26:43 -04:00
Steve Dower 8fc8980c96 Issue #23524: Replace _PyVerify_fd function with calls to _set_thread_local_invalid_parameter_handler. 2015-04-12 00:26:27 -04:00
Serhiy Storchaka 3d2279f9a8 Issue #21859: Corrected FileIO docstrings. 2015-04-10 16:08:43 +03:00
Steve Dower fe0a41aae4 Issue #23668: Adds support for os.truncate and os.ftruncate on Windows 2015-03-20 19:50:46 -07:00
doko@ubuntu.com 6433e9efde - Modules/Setup.dist: remove time extension duplicate, introduced by the fix for #5309. 2015-04-12 00:13:52 +02:00
Serhiy Storchaka cd092efb16 Issue #21859: Corrected FileIO docstrings. 2015-04-10 16:09:13 +03:00
Serhiy Storchaka 5056769b36 Replaced "string" with "bytes object" in docstrings of binary I/O objects. 2015-04-10 02:19:57 +03:00
Serhiy Storchaka b817b77a8c Replaced "string" with "bytes object" in docstrings of binary I/O objects. 2015-04-10 02:18:44 +03:00
Benjamin Peterson 43b842775f remove extra arguments in arg parsing format codes (closes #23875) 2015-04-06 13:05:22 -04:00
Victor Stinner ced1174525 Issue #23618: Fix internal_select() for negative timeout (blocking socket) when
poll() is not available.

select() doesn't accept negative timeout, the timeout parameter must be NULL to
block on select().
2015-04-09 10:27:25 +02:00
Victor Stinner 88ed640fc7 Issue #23834: Fix the default socket timeout
Use -1 second by default, not -1 nanosecond.
2015-04-09 10:23:12 +02:00
Victor Stinner 146907081c Issue #23853: Methods of SSL socket don't reset the socket timeout anymore each
time bytes are received or sent. The socket timeout is now the maximum total
duration of the method.

This change fixes a denial of service if the application is regulary
interrupted by a signal and the signal handler does not raise an exception.
2015-04-06 22:46:13 +02:00
Victor Stinner 222dfc7d94 Issue #22117: Fix sock_call_ex() for non-blocking socket
Call internal_select() with a timeout of 0 second, not a timeout of -1 second
(blocking)!
2015-04-06 22:30:41 +02:00
Victor Stinner 8912d1418e Issue #23853: socket.socket.sendall() does no more reset the socket timeout
each time data is sent successfuly. The socket timeout is now the maximum total
duration to send all data.
2015-04-06 23:16:34 +02:00
Victor Stinner 9001d8089c Issue #23834: Fix initial value of the socket timeout
Use _PyTime_FromSeconds() to initialize the default socket timeout to -1
second, instead of -1 nanosecond which causes rounding issues in
internal_select().
2015-04-06 23:06:01 +02:00
Benjamin Peterson 7d71c97ec3 merge 3.4 (#23875) 2015-04-06 13:06:21 -04:00
Serhiy Storchaka a4c6badfdd Issue #23501: #include "clinic/posixmodule.c.h" was in the section skipped on Windows. 2015-04-04 23:35:52 +03:00
Benjamin Peterson 1a6292194b fix refleak in deque_concat 2015-04-04 10:52:36 -04:00
Serhiy Storchaka 04e6dba7dc Fixed the array module broken in issue #23492.
array_array_frombytes() is used in other functions, but it's signature was
changed. Closes issue #23866.
2015-04-04 17:06:55 +03:00
Serhiy Storchaka 06e66108c6 Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
returns bool.  tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj).  tkinter.BooleanVar.get() now always returns bool.
2015-04-04 12:44:30 +03:00
Serhiy Storchaka 9a6e201f7d Issue #15133: _tkinter.tkapp.getboolean() now supports Tcl_Obj and always
returns bool.  tkinter.BooleanVar now validates input values (accepted bool,
int, str, and Tcl_Obj).  tkinter.BooleanVar.get() now always returns bool.
2015-04-04 12:43:01 +03:00
Serhiy Storchaka f8aa133cce Issue #23338: Fixed formatting ctypes error messages on Cygwin.
Patch by Makoto Kato.
2015-04-04 10:06:58 +03:00
Serhiy Storchaka 2e229e025c Issue #23338: Fixed formatting ctypes error messages on Cygwin.
Patch by Makoto Kato.
2015-04-04 10:05:48 +03:00
Serhiy Storchaka 92e8af67a8 Issue #23492: Argument Clinic now generates argument parsing code with
PyArg_Parse instead of PyArg_ParseTuple if possible.
2015-04-04 00:12:11 +03:00
Serhiy Storchaka 1009bf18b3 Issue #23501: Argumen Clinic now generates code into separate files by default. 2015-04-03 23:53:51 +03:00
Larry Hastings 0759f84d62 Issue #23500: Argument Clinic is now smarter about generating the "#ifndef"
(empty) definition of the methoddef macro: it's only generated once, even
if Argument Clinic processes the same symbol multiple times, and it's emitted
at the end of all processing rather than immediately after the first use.
2015-04-03 13:09:02 -07:00
Serhiy Storchaka 45ec3288d0 Removed trailing whitespaces in miscalenous files. 2015-04-03 19:42:32 +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
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
Serhiy Storchaka ea134da929 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:46:50 +03:00
Victor Stinner 8e44aa5ae4 Issue #23834: Fix socket.sendto(), use the C Py_ssize_t type to store the
result of sendto() instead of the C int type.
2015-04-02 17:16:08 +02:00
Victor Stinner 33f96f1800 Merge 3.4 (_posixsubprocess) 2015-04-02 16:25:01 +02:00
Victor Stinner e7c749238e Issue #23851: close() must not be retried when it fails with EINTR
See the PEP 475 for the rationale.
2015-04-02 16:24:46 +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 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 35bee932e4 Issue #23618: Don't declare recvmsg/sendmsg helper functions on Windows 2015-04-02 12:28:07 +02: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 f7de3dd02d Issue #21526: Tkinter now supports new boolean type in Tcl 8.5. 2015-04-02 10:35:57 +03: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