On 7/18/2010 2:20 PM, David Cournapeau wrote:
On Sun, Jul 18, 2010 at 8:34 PM, Peter
<numpy-discuss...@maubp.freeserve.co.uk>  wrote:
On Sun, Jul 18, 2010 at 6:02 PM, cool-RR<cool...@cool-rr.com>  wrote:
Hello.
I'd appreciate if the NumPy team could provide an MSI installer
for Python 2.7.
Thanks,
Ram Rachum.

You're not the only person who would like this - it was discussed
here just 9 days ago, thread title "A release for python 2.7?", and
the conclusion was we'd have to wait for Numpy 1.5, probably in
August.

It seems that building from the 1.4.x branch works out of the box, so
at least a numpy msi should be straightforward,


Binaries built from the numpy 1.4.x branch do crash on Python 2.7 because of this: http://projects.scipy.org/numpy/ticket/1345. The fix is easy to backport (attached). Until yesterday another reason not to release numpy 1.4.1 binaries for Python 2.7 was the projected use of PyCapsule instead of PyCObject in numpy 1.5+.

--
Christoph
Index: src/multiarray/numpyos.c
=================================================================
--- src/multiarray/numpyos.c    (revision 8498)
+++ src/multiarray/numpyos.c    (working copy)
@@ -418,6 +418,32 @@
     return 0;
 }

+/*
+ * _NumPyOS_ascii_strtod_plain:
+ *
+ * PyOS_ascii_strtod work-alike, with no enhanced features,
+ * for forward compatibility with Python >= 2.7
+ */
+static double
+NumPyOS_ascii_strtod_plain(const char *s, char** endptr)
+{
+    double result;
+#if PY_VERSION_HEX >= 0x02070000
+    NPY_ALLOW_C_API_DEF
+    NPY_ALLOW_C_API
+    result = PyOS_string_to_double(s, endptr, NULL);
+    if (PyErr_Occurred()) {
+        if (endptr) {
+            *endptr = (char*)s;
+        }
+        PyErr_Clear();
+    }
+    NPY_DISABLE_C_API
+#else
+    result = PyOS_ascii_strtod(s, endptr);
+#endif
+    return result;
+}

 /*
  * NumPyOS_ascii_strtod:
@@ -506,7 +532,7 @@
             }
             memcpy(buffer, s, n);
             buffer[n] = '\0';
-            result = PyOS_ascii_strtod(buffer, &q);
+            result = NumPyOS_ascii_strtod_plain(buffer, &q);
             if (endptr != NULL) {
                 *endptr = (char*)(s + (q - buffer));
             }
@@ -515,7 +541,7 @@
     }
     /* End of ##2 */

-    return PyOS_ascii_strtod(s, endptr);
+    return NumPyOS_ascii_strtod_plain(s, endptr);
 }
_______________________________________________
NumPy-Discussion mailing list
NumPy-Discussion@scipy.org
http://mail.scipy.org/mailman/listinfo/numpy-discussion

Reply via email to