Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL,
if all necessary functions are already found in libuuid.
Patch by Evgeny Sologubov.
Issue #18784: The uuid module no more attempts to load libc via ctypes.CDLL,
if all necessary functions are already found in libuuid.
Patch by Evgeny Sologubov.
Tim Peters [Mon, 9 Sep 2013 23:48:24 +0000 (18:48 -0500)]
Get "stopped" back into repr(Thread) when appropriate.
Due to recent changes, a Thread doesn't know that it's over before
someone calls .join() or .is_alive(). That meant repr(Thread)
continued to include "started" (and not "stopped") before one of
those methods was called, even if hours passed since the thread
ended.
Tim Peters [Sun, 8 Sep 2013 23:44:40 +0000 (18:44 -0500)]
Issue 18984: Remove ._stopped Event from Thread internals.
The fix for issue 18808 left us checking two things to be sure a Thread
was done: an Event (._stopped) and a mutex (._tstate_lock). Clumsy &
brittle. This patch removes the Event, leaving just a happy lock :-)
The bulk of the patch removes two excruciating tests, which were
verifying sanity of the internals of the ._stopped Event after a fork.
Thanks to Antoine Pitrou for verifying that's the only real value
these tests had.
One consequence of moving from an Event to a mutex: waiters (threads
calling Thread.join()) used to block each on their own unique mutex
(internal to the ._stopped event), but now all contend on the same
mutex (._tstate_lock). These approaches have different performance
characteristics on different platforms. I don't think it matters in
this context.
Antoine Pitrou [Sun, 8 Sep 2013 11:19:06 +0000 (13:19 +0200)]
Issue #18808 again: fix the after-fork logic for not-yet-started or already-stopped threads.
(AFAICT, in theory, we must reset all the locks, not just those in use)
Victor Stinner [Sun, 8 Sep 2013 09:36:23 +0000 (11:36 +0200)]
Close #18957: The PYTHONFAULTHANDLER environment variable now only enables the
faulthandler module if the variable is non-empty. Same behaviour than other
variables like PYTHONDONTWRITEBYTECODE.
The setobject freelist was consuming memory but not providing much value.
Even when a freelisted setobject was available, most of the setobject
fields still needed to be initialized and the small table still required
a memset(). This meant that the custom freelisting scheme for sets was
providing almost no incremental benefit over the default Python freelist
scheme used by _PyObject_Malloc() in Objects/obmalloc.c.
Tim Peters [Sun, 8 Sep 2013 02:23:03 +0000 (21:23 -0500)]
Issue 18808: blind attempt to repair some buildbot failures.
test_is_alive_after_fork is failing on some old Linux kernels, but
passing on all newer ones. Since virtually anything can go wrong
with locks when mixing threads with fork, replace the most likely
cause with a redundant simple data member.
Nick Coghlan [Sun, 8 Sep 2013 01:40:34 +0000 (11:40 +1000)]
Close #18952: correctly download test support data
When test.support was converted to a package, it started silently
skipping the tests which needed to download support data to run.
This change refactors the affected code, and also tidies up
test.support.findfile to remove the unused *here* parameter, document
the *subdir* parameter and rename the *filename* parameter to avoid
shadowing the file builtin and be consistent with the documentation.
The unexpected skips were noticed and reported by Zachary Ware
Antoine Pitrou [Sat, 7 Sep 2013 21:38:37 +0000 (23:38 +0200)]
Issue #18808: Thread.join() now waits for the underlying thread state to be destroyed before returning.
This prevents unpredictable aborts in Py_EndInterpreter() when some non-daemon threads are still running.
Ned Deily [Fri, 6 Sep 2013 22:16:19 +0000 (15:16 -0700)]
Issue #18458: Prevent crashes with newer versions of libedit. Its readline
emulation has changed from 0-based indexing to 1-based like gnu readline.
Original patch by Ronald Oussoren.
Eli Bendersky [Fri, 6 Sep 2013 13:14:16 +0000 (06:14 -0700)]
Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
existing directory caused mkstemp and related APIs to fail instead of
retrying. Report and fix by Vlad Shcherbina.
Eli Bendersky [Fri, 6 Sep 2013 13:11:19 +0000 (06:11 -0700)]
Issue #18849: Fixed a Windows-specific tempfile bug where collision with an
existing directory caused mkstemp and related APIs to fail instead of
retrying. Report and fix by Vlad Shcherbina.