git.iko.soy/typeable/nixpkgs
on master help sign in
python: 2.7.8 -> 2.7.9

(cherry picked from commit 1f059cd5a91fee7d4ec50c7272bca5bc6733f245) Signed-off-by: Domen Kožar <domen@dev.si>

commit272206e7063a9275c737a018f507bd463e4b58cc authorDomen Kožar <domen@dev.si> dateSun 14 Dec 2014, 19:05 (12 years ago) parent64661f0
2 files changed+2−175
pkgs/development/interpreters/python/2.7/default.nix+2−5 pkgs/development/interpreters/python/2.7/remove-avoid-daemon-thread-shutdown.patch−170
pkgs/development/interpreters/python/2.7/default.nix+2−5
@@ -7,11 +7,11 @@ with stdenv.lib;
77
88let
99 majorVersion = "2.7";
10− version = "${majorVersion}.8";
10+ version = "${majorVersion}.9";
1111
1212 src = fetchurl {
1313 url = "http://www.python.org/ftp/python/${version}/Python-${version}.tar.xz";
14− sha256 = "0nh7d3dp75f1aj0pamn4hla8s0l7nbaq4a38brry453xrfh11ppd";
14+ sha256 = "05j9in7yygfgl6nml0rixfvj1bbip982w3l54q05f0vyx8a7xllh";
1515 };
1616
1717 patches =
@@ -27,9 +27,6 @@ let
2727 # patch python to put zero timestamp into pyc
2828 # if DETERMINISTIC_BUILD env var is set
2929 ./deterministic-build.patch
30−
31− # http://bugs.python.org/issue21963
32− ./remove-avoid-daemon-thread-shutdown.patch
3330 ];
3431
3532 preConfigure = ''
pkgs/development/interpreters/python/2.7/remove-avoid-daemon-thread-shutdown.patchdeleted−170
@@ -1,170 +0,0 @@
1−changeset: 93046:61ad2208a5ce
2−branch: 2.7
3−tag: tip
4−user: William A. Kennington III <william@wkennington.com>
5−date: Mon Oct 13 13:57:12 2014 -0700
6−summary: Revert: 91229:7741d0dd66ca to fix i21963
7−
8−diff -r ed4098380799 -r 61ad2208a5ce Include/pythonrun.h
9−--- a/Include/pythonrun.h Mon Oct 13 12:58:03 2014 -0700
10−+++ b/Include/pythonrun.h Mon Oct 13 13:57:12 2014 -0700
11−@@ -147,8 +147,6 @@
12− PyAPI_FUNC(void) PyByteArray_Fini(void);
13− PyAPI_FUNC(void) _PyRandom_Fini(void);
14−
15−-PyAPI_DATA(PyThreadState *) _Py_Finalizing;
16−-
17− /* Stuff with no proper home (yet) */
18− PyAPI_FUNC(char *) PyOS_Readline(FILE *, FILE *, char *);
19− PyAPI_DATA(int) (*PyOS_InputHook)(void);
20−diff -r ed4098380799 -r 61ad2208a5ce Lib/test/test_threading.py
21−--- a/Lib/test/test_threading.py Mon Oct 13 12:58:03 2014 -0700
22−+++ b/Lib/test/test_threading.py Mon Oct 13 13:57:12 2014 -0700
23−@@ -700,49 +700,6 @@
24− output = "end of worker thread\nend of main thread\n"
25− self.assertScriptHasOutput(script, output)
26−
27−- @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
28−- def test_6_daemon_threads(self):
29−- # Check that a daemon thread cannot crash the interpreter on shutdown
30−- # by manipulating internal structures that are being disposed of in
31−- # the main thread.
32−- script = """if True:
33−- import os
34−- import random
35−- import sys
36−- import time
37−- import threading
38−-
39−- thread_has_run = set()
40−-
41−- def random_io():
42−- '''Loop for a while sleeping random tiny amounts and doing some I/O.'''
43−- while True:
44−- in_f = open(os.__file__, 'rb')
45−- stuff = in_f.read(200)
46−- null_f = open(os.devnull, 'wb')
47−- null_f.write(stuff)
48−- time.sleep(random.random() / 1995)
49−- null_f.close()
50−- in_f.close()
51−- thread_has_run.add(threading.current_thread())
52−-
53−- def main():
54−- count = 0
55−- for _ in range(40):
56−- new_thread = threading.Thread(target=random_io)
57−- new_thread.daemon = True
58−- new_thread.start()
59−- count += 1
60−- while len(thread_has_run) < count:
61−- time.sleep(0.001)
62−- # Trigger process shutdown
63−- sys.exit(0)
64−-
65−- main()
66−- """
67−- rc, out, err = assert_python_ok('-c', script)
68−- self.assertFalse(err)
69−-
70− @unittest.skipUnless(hasattr(os, 'fork'), "needs os.fork()")
71− @unittest.skipIf(sys.platform in platforms_to_skip, "due to known OS bug")
72− def test_reinit_tls_after_fork(self):
73−diff -r ed4098380799 -r 61ad2208a5ce Misc/NEWS
74−--- a/Misc/NEWS Mon Oct 13 12:58:03 2014 -0700
75−+++ b/Misc/NEWS Mon Oct 13 13:57:12 2014 -0700
76−@@ -96,10 +96,6 @@
77− - Issue #21831: Avoid integer overflow when large sizes and offsets are given to
78− the buffer type.
79−
80−-- Issue #1856: Avoid crashes and lockups when daemon threads run while the
81−- interpreter is shutting down; instead, these threads are now killed when they
82−- try to take the GIL.
83−-
84− - Issue #19656: Running Python with the -3 option now also warns about
85− non-ascii bytes literals.
86−
87−diff -r ed4098380799 -r 61ad2208a5ce Python/ceval.c
88−--- a/Python/ceval.c Mon Oct 13 12:58:03 2014 -0700
89−+++ b/Python/ceval.c Mon Oct 13 13:57:12 2014 -0700
90−@@ -355,12 +355,6 @@
91− if (interpreter_lock) {
92− int err = errno;
93− PyThread_acquire_lock(interpreter_lock, 1);
94−- /* _Py_Finalizing is protected by the GIL */
95−- if (_Py_Finalizing && tstate != _Py_Finalizing) {
96−- PyThread_release_lock(interpreter_lock);
97−- PyThread_exit_thread();
98−- assert(0); /* unreachable */
99−- }
100− errno = err;
101− }
102− #endif
103−@@ -1024,13 +1018,6 @@
104− /* Other threads may run now */
105−
106− PyThread_acquire_lock(interpreter_lock, 1);
107−-
108−- /* Check if we should make a quick exit. */
109−- if (_Py_Finalizing && _Py_Finalizing != tstate) {
110−- PyThread_release_lock(interpreter_lock);
111−- PyThread_exit_thread();
112−- }
113−-
114− if (PyThreadState_Swap(tstate) != NULL)
115− Py_FatalError("ceval: orphan tstate");
116−
117−diff -r ed4098380799 -r 61ad2208a5ce Python/pythonrun.c
118−--- a/Python/pythonrun.c Mon Oct 13 12:58:03 2014 -0700
119−+++ b/Python/pythonrun.c Mon Oct 13 13:57:12 2014 -0700
120−@@ -91,8 +91,6 @@
121− int Py_NoUserSiteDirectory = 0; /* for -s and site.py */
122− int Py_HashRandomizationFlag = 0; /* for -R and PYTHONHASHSEED */
123−
124−-PyThreadState *_Py_Finalizing = NULL;
125−-
126−
127− /* Hack to force loading of object files */
128− int (*_PyOS_mystrnicmp_hack)(const char *, const char *, Py_ssize_t) = \
129−@@ -165,7 +163,6 @@
130− if (initialized)
131− return;
132− initialized = 1;
133−- _Py_Finalizing = NULL;
134−
135− if ((p = Py_GETENV("PYTHONDEBUG")) && *p != '\0')
136− Py_DebugFlag = add_flag(Py_DebugFlag, p);
137−@@ -425,16 +422,12 @@
138− * the threads created via Threading.
139− */
140− call_sys_exitfunc();
141−+ initialized = 0;
142−
143− /* Get current thread state and interpreter pointer */
144− tstate = PyThreadState_GET();
145− interp = tstate->interp;
146−
147−- /* Remaining threads (e.g. daemon threads) will automatically exit
148−- after taking the GIL (in PyEval_RestoreThread()). */
149−- _Py_Finalizing = tstate;
150−- initialized = 0;
151−-
152− /* Disable signal handling */
153− PyOS_FiniInterrupts();
154−
155−diff -r ed4098380799 -r 61ad2208a5ce Python/thread_pthread.h
156−--- a/Python/thread_pthread.h Mon Oct 13 12:58:03 2014 -0700
157−+++ b/Python/thread_pthread.h Mon Oct 13 13:57:12 2014 -0700
158−@@ -242,9 +242,9 @@
159− PyThread_exit_thread(void)
160− {
161− dprintf(("PyThread_exit_thread called\n"));
162−- if (!initialized)
163−+ if (!initialized) {
164− exit(0);
165−- pthread_exit(0);
166−+ }
167− }
168−
169− #ifdef USE_SEMAPHORES
170−