Github messages for voidlinux
 help / color / mirror / Atom feed
* [PR PATCH] python3-numpy: backport big endian patch
@ 2019-10-24 13:46 voidlinux-github
  2019-10-25 18:36 ` [PR PATCH] [Merged]: " voidlinux-github
  0 siblings, 1 reply; 2+ messages in thread
From: voidlinux-github @ 2019-10-24 13:46 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 365 bytes --]

There is a new pull request by q66 against master on the void-packages repository

https://github.com/void-ppc/void-packages numpy
https://github.com/void-linux/void-packages/pull/15755

python3-numpy: backport big endian patch
Ref https://github.com/numpy/numpy/pull/14769

A patch file from https://github.com/void-linux/void-packages/pull/15755.patch is attached

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #2: github-pr-numpy-15755.patch --]
[-- Type: text/x-diff, Size: 2891 bytes --]

From 6a2db6911ac4a71b0bec839379626264cab610c3 Mon Sep 17 00:00:00 2001
From: q66 <daniel@octaforge.org>
Date: Thu, 24 Oct 2019 15:31:27 +0200
Subject: [PATCH] python3-numpy: backport big endian patch

Ref https://github.com/numpy/numpy/pull/14769

[ci skip]
---
 .../python3-numpy/patches/big-endian.patch    | 51 +++++++++++++++++++
 1 file changed, 51 insertions(+)
 create mode 100644 srcpkgs/python3-numpy/patches/big-endian.patch

diff --git a/srcpkgs/python3-numpy/patches/big-endian.patch b/srcpkgs/python3-numpy/patches/big-endian.patch
new file mode 100644
index 00000000000..7721688b200
--- /dev/null
+++ b/srcpkgs/python3-numpy/patches/big-endian.patch
@@ -0,0 +1,51 @@
+From af36784b2b38577a87208003d6827d02dc0c0fc2 Mon Sep 17 00:00:00 2001
+From: Michael Hudson-Doyle <michael.hudson@canonical.com>
+Date: Thu, 24 Oct 2019 21:46:00 +1300
+Subject: [PATCH] BUG: fix integer size confusion in handling array's ndmin
+ argument
+
+The ndmin local variable was changed from an "int" to an "npy_intp" but
+&ndmin is passed to PyArg_ParseTupleAndKeywords against a "i" argument
+spec, but these integers have different sizes (well on an LP64 platform
+anyway). This actually works on a little endian system but fails
+on a big endian one. Fix this by converting the local back to an int,
+and being a little careful before assigning the result of PyLong_AsLong to
+it.
+
+Fixes #14767
+---
+ numpy/core/src/multiarray/multiarraymodule.c | 10 +++++-----
+ 1 file changed, 5 insertions(+), 5 deletions(-)
+
+diff --git a/numpy/core/src/multiarray/multiarraymodule.c b/numpy/core/src/multiarray/multiarraymodule.c
+index 44156704996..9693275e74d 100644
+--- numpy/core/src/multiarray/multiarraymodule.c
++++ numpy/core/src/multiarray/multiarraymodule.c
+@@ -1562,8 +1562,7 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
+     PyArrayObject *oparr = NULL, *ret = NULL;
+     npy_bool subok = NPY_FALSE;
+     npy_bool copy = NPY_TRUE;
+-    int nd;
+-    npy_intp ndmin = 0;
++    int ndmin = 0, nd;
+     PyArray_Descr *type = NULL;
+     PyArray_Descr *oldtype = NULL;
+     NPY_ORDER order = NPY_KEEPORDER;
+@@ -1625,13 +1624,14 @@ _array_fromobject(PyObject *NPY_UNUSED(ignored), PyObject *args, PyObject *kws)
+ 
+             ndmin_obj = PyDict_GetItem(kws, npy_ma_str_ndmin);
+             if (ndmin_obj) {
+-                ndmin = PyLong_AsLong(ndmin_obj);
+-                if (error_converting(ndmin)) {
++                long t = PyLong_AsLong(ndmin_obj);
++                if (error_converting(t)) {
+                     goto clean_type;
+                 }
+-                else if (ndmin > NPY_MAXDIMS) {
++                else if (t > NPY_MAXDIMS) {
+                     goto full_path;
+                 }
++                ndmin = t;
+             }
+ 
+             /* copy=False with default dtype, order (any is OK) and ndim */

^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: [PR PATCH] [Merged]: python3-numpy: backport big endian patch
  2019-10-24 13:46 [PR PATCH] python3-numpy: backport big endian patch voidlinux-github
@ 2019-10-25 18:36 ` voidlinux-github
  0 siblings, 0 replies; 2+ messages in thread
From: voidlinux-github @ 2019-10-25 18:36 UTC (permalink / raw)
  To: ml

[-- Attachment #1: Type: text/plain, Size: 219 bytes --]

There's a merged pull request on the void-packages repository

python3-numpy: backport big endian patch
https://github.com/void-linux/void-packages/pull/15755

Description:
Ref https://github.com/numpy/numpy/pull/14769

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2019-10-25 18:36 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-10-24 13:46 [PR PATCH] python3-numpy: backport big endian patch voidlinux-github
2019-10-25 18:36 ` [PR PATCH] [Merged]: " voidlinux-github

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).