Merge lp:~barry/ubuntu/natty/python-numpy/685469-crash into lp:ubuntu/natty/python-numpy

Proposed by Barry Warsaw
Status: Merged
Merged at revision: 13
Proposed branch: lp:~barry/ubuntu/natty/python-numpy/685469-crash
Merge into: lp:ubuntu/natty/python-numpy
Diff against target: 96 lines (+76/-0)
3 files modified
debian/changelog (+9/-0)
debian/patches/changeset_r8394.diff (+66/-0)
debian/patches/series (+1/-0)
To merge this branch: bzr merge lp:~barry/ubuntu/natty/python-numpy/685469-crash
Reviewer Review Type Date Requested Status
Ubuntu branches Pending
Review via email: mp+43986@code.launchpad.net

Description of the change

python-numpy (1:1.4.1-5ubuntu4) natty; urgency=low

  * Fix pymvpa crash caused by numpy incompatibility with Python 2.7.
    This is a back port of the numpy upstream changeset:
    http://projects.scipy.org/numpy/changeset/8394
    (LP: #685469)

 -- Barry Warsaw <email address hidden> Thu, 16 Dec 2010 15:57:29 -0500

To post a comment you must log in.

Preview Diff

[H/L] Next/Prev Comment, [J/K] Next/Prev File, [N/P] Next/Prev Hunk
1=== modified file 'debian/changelog'
2--- debian/changelog 2010-12-11 01:02:18 +0000
3+++ debian/changelog 2010-12-16 22:22:13 +0000
4@@ -1,3 +1,12 @@
5+python-numpy (1:1.4.1-5ubuntu4) natty; urgency=low
6+
7+ * Fix pymvpa crash caused by numpy incompatibility with Python 2.7.
8+ This is a back port of the numpy upstream changeset:
9+ http://projects.scipy.org/numpy/changeset/8394
10+ (LP: #685469)
11+
12+ -- Barry Warsaw <barry@ubuntu.com> Thu, 16 Dec 2010 15:57:29 -0500
13+
14 python-numpy (1:1.4.1-5ubuntu3) natty; urgency=low
15
16 * Rebuild with python2.7 as the default python version.
17
18=== added file 'debian/patches/changeset_r8394.diff'
19--- debian/patches/changeset_r8394.diff 1970-01-01 00:00:00 +0000
20+++ debian/patches/changeset_r8394.diff 2010-12-16 22:22:13 +0000
21@@ -0,0 +1,66 @@
22+--- a/numpy/core/src/multiarray/numpyos.c
23++++ b/numpy/core/src/multiarray/numpyos.c
24+@@ -418,6 +418,32 @@
25+ return 0;
26+ }
27+
28++/*
29++ * _NumPyOS_ascii_strtod_plain:
30++ *
31++ * PyOS_ascii_strtod work-alike, with no enhanced features,
32++ * for forward compatibility with Python >= 2.7
33++ */
34++static double
35++NumPyOS_ascii_strtod_plain(const char *s, char** endptr)
36++{
37++ double result;
38++#if PY_VERSION_HEX >= 0x02070000
39++ NPY_ALLOW_C_API_DEF
40++ NPY_ALLOW_C_API
41++ result = PyOS_string_to_double(s, endptr, NULL);
42++ if (PyErr_Occurred()) {
43++ if (endptr) {
44++ *endptr = (char*)s;
45++ }
46++ PyErr_Clear();
47++ }
48++ NPY_DISABLE_C_API
49++#else
50++ result = PyOS_ascii_strtod(s, endptr);
51++#endif
52++ return result;
53++}
54+
55+ /*
56+ * NumPyOS_ascii_strtod:
57+@@ -506,7 +532,7 @@
58+ }
59+ memcpy(buffer, s, n);
60+ buffer[n] = '\0';
61+- result = PyOS_ascii_strtod(buffer, &q);
62++ result = NumPyOS_ascii_strtod_plain(buffer, &q);
63+ if (endptr != NULL) {
64+ *endptr = (char*)(s + (q - buffer));
65+ }
66+@@ -515,7 +541,7 @@
67+ }
68+ /* End of ##2 */
69+
70+- return PyOS_ascii_strtod(s, endptr);
71++ return NumPyOS_ascii_strtod_plain(s, endptr);
72+ }
73+
74+
75+--- a/numpy/core/tests/test_regression.py
76++++ b/numpy/core/tests/test_regression.py
77+@@ -1235,6 +1235,10 @@
78+ assert_(np.isfinite(np.log1p(np.exp2(-53))))
79+
80+
81++ def test_fromstring_crash(self):
82++ # Ticket #1345: the following should not cause a crash
83++ np.fromstring(asbytes('aa, aa, 1.0'), sep=',')
84++
85+ if __name__ == "__main__":
86+ run_module_suite()
87+ def test_duplicate_title_and_name(self):
88
89=== modified file 'debian/patches/series'
90--- debian/patches/series 2010-10-07 10:19:13 +0000
91+++ debian/patches/series 2010-12-16 22:22:13 +0000
92@@ -8,3 +8,4 @@
93 changeset_r8511.diff
94 changeset_r8526.diff
95 changeset_r8364.diff
96+changeset_r8394.diff

Subscribers

People subscribed via source and target branches

to all changes: