[Python-modules-commits] r28040 - in packages/numpy/trunk/debian (5 files)

jtaylor-guest at users.alioth.debian.org jtaylor-guest at users.alioth.debian.org
Thu Mar 6 19:57:58 UTC 2014


    Date: Thursday, March 6, 2014 @ 19:57:58
  Author: jtaylor-guest
Revision: 28040

add upstream patch to restore private api used by matplotlib

also refresh the other patches

Added:
  packages/numpy/trunk/debian/patches/restore-3kcompat-api.patch
Modified:
  packages/numpy/trunk/debian/changelog
  packages/numpy/trunk/debian/patches/02_build_dotblas.patch
  packages/numpy/trunk/debian/patches/python3-soabi.patch
  packages/numpy/trunk/debian/patches/series

Modified: packages/numpy/trunk/debian/changelog
===================================================================
--- packages/numpy/trunk/debian/changelog	2014-03-06 19:04:38 UTC (rev 28039)
+++ packages/numpy/trunk/debian/changelog	2014-03-06 19:57:58 UTC (rev 28040)
@@ -14,6 +14,8 @@
   * debian/python3-numpy-dbg.install:
     - fix duplicate files in dbg package of kfreebsd (Closes: #740318)
   * bump Standards-Version to 3.9.5 (no changes needed)
+  * restore-3kcompat-api.patch:
+    add upstream patch to restore private api used by matplotlib
 
  -- Julian Taylor <jtaylor.debian at googlemail.com>  Sun, 02 Mar 2014 15:33:25 +0100
 

Modified: packages/numpy/trunk/debian/patches/02_build_dotblas.patch
===================================================================
--- packages/numpy/trunk/debian/patches/02_build_dotblas.patch	2014-03-06 19:04:38 UTC (rev 28039)
+++ packages/numpy/trunk/debian/patches/02_build_dotblas.patch	2014-03-06 19:57:58 UTC (rev 28040)
@@ -3,7 +3,7 @@
 Added by: Tiziano Zito <otizonaizit at yahoo.com>
 --- a/numpy/core/setup.py
 +++ b/numpy/core/setup.py
-@@ -929,8 +929,8 @@ def configuration(parent_package='',top_
+@@ -933,8 +933,8 @@ def configuration(parent_package='',top_
      #blas_info = {}
      def get_dotblas_sources(ext, build_dir):
          if blas_info:

Modified: packages/numpy/trunk/debian/patches/python3-soabi.patch
===================================================================
--- packages/numpy/trunk/debian/patches/python3-soabi.patch	2014-03-06 19:04:38 UTC (rev 28039)
+++ packages/numpy/trunk/debian/patches/python3-soabi.patch	2014-03-06 19:57:58 UTC (rev 28040)
@@ -8,7 +8,7 @@
 Forwarded: not-needed, debian specific
 --- a/numpy/ctypeslib.py
 +++ b/numpy/ctypeslib.py
-@@ -107,6 +107,14 @@
+@@ -107,6 +107,14 @@ else:
              so_ext2 = get_shared_lib_extension(is_python_ext=True)
              if not so_ext2 == so_ext:
                  libname_ext.insert(0, libname + so_ext2)
@@ -25,7 +25,7 @@
  
 --- a/numpy/tests/test_ctypeslib.py
 +++ b/numpy/tests/test_ctypeslib.py
-@@ -25,6 +25,7 @@
+@@ -25,6 +25,7 @@ class TestLoadLibrary(TestCase):
                    " (import error was: %s)" % str(e)
              print(msg)
  

Added: packages/numpy/trunk/debian/patches/restore-3kcompat-api.patch
===================================================================
--- packages/numpy/trunk/debian/patches/restore-3kcompat-api.patch	                        (rev 0)
+++ packages/numpy/trunk/debian/patches/restore-3kcompat-api.patch	2014-03-06 19:57:58 UTC (rev 28040)
@@ -0,0 +1,147 @@
+Author: Julian Taylor <jtaylor.debian at googlemail.com>
+Origin 0bfcb0e36e90f1300a27848ce7d419292d0a53c0
+Applied-Upstream: 1.8.1
+Description: restore api for file npy_PyFile_Dup and npy_PyFile_DupClose
+
+--- a/doc/release/1.8.1-notes.rst
++++ b/doc/release/1.8.1-notes.rst
+@@ -47,3 +47,16 @@ Issues fixed
+ * gh-4225: fix log1p and exmp1 return for np.inf on windows compiler builds
+ * gh-4359: Fix infinite recursion in str.format of flex arrays
+ * gh-4145: Incorrect shape of broadcast result with the exponent operator
++
++Deprecations
++============
++
++C-API
++~~~~~
++
++The utility function npy_PyFile_Dup and npy_PyFile_DupClose are broken by the
++internal buffering python 3 applies to its file objects.
++To fix this two new functions npy_PyFile_Dup2 and npy_PyFile_DupClose2 are
++declared in npy_3kcompat.h and the old functions are deprecated.
++Due to the fragile nature of these functions it is recommended to instead use
++the python API when possible.
+--- a/numpy/core/include/numpy/npy_3kcompat.h
++++ b/numpy/core/include/numpy/npy_3kcompat.h
+@@ -141,12 +141,11 @@ PyUnicode_Concat2(PyObject **left, PyObj
+  * PyFile_* compatibility
+  */
+ #if defined(NPY_PY3K)
+-
+ /*
+  * Get a FILE* handle to the file represented by the Python object
+  */
+ static NPY_INLINE FILE*
+-npy_PyFile_Dup(PyObject *file, char *mode, npy_off_t *orig_pos)
++npy_PyFile_Dup2(PyObject *file, char *mode, npy_off_t *orig_pos)
+ {
+     int fd, fd2;
+     PyObject *ret, *os;
+@@ -221,7 +220,7 @@ npy_PyFile_Dup(PyObject *file, char *mod
+  * Close the dup-ed file handle, and seek the Python one to the current position
+  */
+ static NPY_INLINE int
+-npy_PyFile_DupClose(PyObject *file, FILE* handle, npy_off_t orig_pos)
++npy_PyFile_DupClose2(PyObject *file, FILE* handle, npy_off_t orig_pos)
+ {
+     int fd;
+     PyObject *ret;
+@@ -269,10 +268,55 @@ npy_PyFile_Check(PyObject *file)
+     return 1;
+ }
+ 
++/*
++ * DEPRECATED DO NOT USE
++ * use npy_PyFile_Dup2 instead
++ * this function will mess ups python3 internal file object buffering
++ * Get a FILE* handle to the file represented by the Python object
++ */
++static NPY_INLINE FILE*
++npy_PyFile_Dup(PyObject *file, char *mode)
++{
++    npy_off_t orig;
++    if (DEPRECATE("npy_PyFile_Dup is deprecated, use "
++                  "npy_PyFile_Dup2") < 0) {
++        return NULL;
++    }
++
++    return npy_PyFile_Dup2(file, mode, &orig);
++}
++
++/*
++ * DEPRECATED DO NOT USE
++ * use npy_PyFile_DupClose2 instead
++ * this function will mess ups python3 internal file object buffering
++ * Close the dup-ed file handle, and seek the Python one to the current position
++ */
++static NPY_INLINE int
++npy_PyFile_DupClose(PyObject *file, FILE* handle)
++{
++    PyObject *ret;
++    Py_ssize_t position;
++    position = npy_ftell(handle);
++    fclose(handle);
++
++    ret = PyObject_CallMethod(file, "seek", NPY_SSIZE_T_PYFMT "i", position, 0);
++    if (ret == NULL) {
++        return -1;
++    }
++    Py_DECREF(ret);
++    return 0;
++}
++
++
+ #else
+ 
+-#define npy_PyFile_Dup(file, mode, orig_pos_p) PyFile_AsFile(file)
+-#define npy_PyFile_DupClose(file, handle, orig_pos) (0)
++/* DEPRECATED DO NOT USE */
++#define npy_PyFile_Dup(file, mode) PyFile_AsFile(file)
++#define npy_PyFile_DupClose(file, handle) (0)
++/* use these */
++#define npy_PyFile_Dup2(file, mode, orig_pos_p) PyFile_AsFile(file)
++#define npy_PyFile_DupClose2(file, handle, orig_pos) (0)
+ #define npy_PyFile_Check PyFile_Check
+ 
+ #endif
+--- a/numpy/core/src/multiarray/methods.c
++++ b/numpy/core/src/multiarray/methods.c
+@@ -588,7 +588,7 @@ array_tofile(PyArrayObject *self, PyObje
+         own = 0;
+     }
+ 
+-    fd = npy_PyFile_Dup(file, "wb", &orig_pos);
++    fd = npy_PyFile_Dup2(file, "wb", &orig_pos);
+     if (fd == NULL) {
+         PyErr_SetString(PyExc_IOError,
+                 "first argument must be a string or open file");
+@@ -597,7 +597,7 @@ array_tofile(PyArrayObject *self, PyObje
+     if (PyArray_ToFile(self, fd, sep, format) < 0) {
+         goto fail;
+     }
+-    if (npy_PyFile_DupClose(file, fd, orig_pos) < 0) {
++    if (npy_PyFile_DupClose2(file, fd, orig_pos) < 0) {
+         goto fail;
+     }
+     if (own && npy_PyFile_CloseFile(file) < 0) {
+--- a/numpy/core/src/multiarray/multiarraymodule.c
++++ b/numpy/core/src/multiarray/multiarraymodule.c
+@@ -1995,7 +1995,7 @@ array_fromfile(PyObject *NPY_UNUSED(igno
+         Py_INCREF(file);
+         own = 0;
+     }
+-    fp = npy_PyFile_Dup(file, "rb", &orig_pos);
++    fp = npy_PyFile_Dup2(file, "rb", &orig_pos);
+     if (fp == NULL) {
+         PyErr_SetString(PyExc_IOError,
+                 "first argument must be an open file");
+@@ -2007,7 +2007,7 @@ array_fromfile(PyObject *NPY_UNUSED(igno
+     }
+     ret = PyArray_FromFile(fp, type, (npy_intp) nin, sep);
+ 
+-    if (npy_PyFile_DupClose(file, fp, orig_pos) < 0) {
++    if (npy_PyFile_DupClose2(file, fp, orig_pos) < 0) {
+         goto fail;
+     }
+     if (own && npy_PyFile_CloseFile(file) < 0) {

Modified: packages/numpy/trunk/debian/patches/series
===================================================================
--- packages/numpy/trunk/debian/patches/series	2014-03-06 19:04:38 UTC (rev 28039)
+++ packages/numpy/trunk/debian/patches/series	2014-03-06 19:57:58 UTC (rev 28040)
@@ -4,3 +4,4 @@
 #05_fix_endianness_detection.patch
 10_use_local_python.org_object.inv_sphinx.diff
 python3-soabi.patch
+restore-3kcompat-api.patch




More information about the Python-modules-commits mailing list