Victor Stinner [Thu, 19 Mar 2015 21:53:20 +0000 (22:53 +0100)]
Issue #23708: Add _Py_read() and _Py_write() functions to factorize code handle
EINTR error and special cases for Windows.
These functions now truncate the length to PY_SSIZE_T_MAX to have a portable
and reliable behaviour. For example, read() result is undefined if counter is
greater than PY_SSIZE_T_MAX on Linux.
Victor Stinner [Thu, 19 Mar 2015 20:54:09 +0000 (21:54 +0100)]
Issue #23646: If time.sleep() is interrupted by a signal, the sleep is now
retried with the recomputed delay, except if the signal handler raises an
exception (PEP 475).
Modify also test_signal to use a monotonic clock instead of the system clock.
Ethan Furman [Thu, 19 Mar 2015 01:19:30 +0000 (18:19 -0700)]
issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method
Ethan Furman [Thu, 19 Mar 2015 00:27:57 +0000 (17:27 -0700)]
issue23673
add private method to enum to support replacing global constants with Enum members:
- search for candidate constants via supplied filter
- create new enum class and members
- insert enum class and replace constants with members via supplied module name
- replace __reduce_ex__ with function that returns member name, so previous Python versions can unpickle
modify IntEnum classes to use new method
Victor Stinner [Wed, 18 Mar 2015 13:39:33 +0000 (14:39 +0100)]
Issue #22181: On Linux, os.urandom() now uses the new getrandom() syscall if
available, syscall introduced in the Linux kernel 3.17. It is more reliable
and more secure, because it avoids the need of a file descriptor and waits
until the kernel has enough entropy.
Serhiy Storchaka [Wed, 18 Mar 2015 08:59:57 +0000 (10:59 +0200)]
Issue #2211: Updated the implementation of the http.cookies.Morsel class.
Setting attributes key, value and coded_value directly now is deprecated.
update() and setdefault() now transform and check keys. Comparing for
equality now takes into account attributes key, value and coded_value.
copy() now returns a Morsel, not a dict. repr() now contains all attributes.
Optimized checking keys and quoting values. Added new tests.
Original patch by Demian Brecht.
Victor Stinner [Tue, 17 Mar 2015 23:22:14 +0000 (00:22 +0100)]
Issue #23694: Enhance _Py_open(), it now raises exceptions
* _Py_open() now raises exceptions on error. If open() fails, it raises an
OSError with the filename.
* _Py_open() now releases the GIL while calling open()
* Add _Py_open_noraise() when _Py_open() cannot be used because the GIL is not
held
Victor Stinner [Tue, 17 Mar 2015 21:53:27 +0000 (22:53 +0100)]
Issue #23644: Fix issues with C++ when compiling Python extensions
Disable completly pyatomic.h on C++, because <stdatomic.h> is not compatible with C++.
<pyatomic.h> is only needed by the optimized PyThreadState_GET() macro in
pystate.h. Instead, declare PyThreadState_GET() as an alias to
PyThreadState_Get(), as done for limited API.
Robert Collins [Tue, 17 Mar 2015 20:54:50 +0000 (09:54 +1300)]
Issue #18983: Allow selection of output units in timeit.
This allows manual selection of a specific unit such as usecs rather than the
use of a heuristic. This is intended to aid machine processing of timeit
output.
Victor Stinner [Mon, 16 Mar 2015 16:57:49 +0000 (17:57 +0100)]
Issue #23680: Reduce risk of race condition in check_interrupted_write_retry()
of test_io. Allocate the large data before scheduling an alarm in 1 second.
On very slow computer, the alarm rings sometimes during the memory allocation.
Eli Bendersky [Sun, 15 Mar 2015 03:17:38 +0000 (20:17 -0700)]
Issue #23549: Clarify confusion in heapq doc - accessing the mininmal element
Merge 3.4
The current documentation only mentions heap[0] as the smallest element in the
beginning, and not in any of the methods' docs. There's no method to access the
minimal element without popping it, and the documentation of nsmallest is
confusing because it may suggest that min() is the way to go for n==1.
Eli Bendersky [Sun, 15 Mar 2015 03:14:23 +0000 (20:14 -0700)]
Issue #23549: Clarify confusion in heapq doc - accessing the mininmal element
The current documentation only mentions heap[0] as the smallest element in the
beginning, and not in any of the methods' docs. There's no method to access the
minimal element without popping it, and the documentation of nsmallest is
confusing because it may suggest that min() is the way to go for n==1.
Serhiy Storchaka [Fri, 13 Mar 2015 06:25:26 +0000 (08:25 +0200)]
Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now
handle exceptions raised by an iterator. Patch by Alon Diamant and Davin
Potts.
Serhiy Storchaka [Fri, 13 Mar 2015 06:30:33 +0000 (08:30 +0200)]
Issue #23051: multiprocessing.Pool methods imap() and imap_unordered() now
handle exceptions raised by an iterator. Patch by Alon Diamant and Davin
Potts.