[numpy] add another fix for unicode support in python3.3
tomspur
tomspur at fedoraproject.org
Sun Aug 5 13:25:00 UTC 2012
commit 9aa5fccb8b981a18d43db0cd65271827e03642ea
Author: Thomas Spura <thomas.spura at gmail.com>
Date: Sun Aug 5 15:24:42 2012 +0200
add another fix for unicode support in python3.3
Signed-off-by: Thomas Spura <thomas.spura at gmail.com>
numpy-1.6.2-unicode-python3.3.patch | 16 ++++++++++++++++
numpy.spec | 1 +
2 files changed, 17 insertions(+), 0 deletions(-)
---
diff --git a/numpy-1.6.2-unicode-python3.3.patch b/numpy-1.6.2-unicode-python3.3.patch
index c7038a5..db21ebe 100644
--- a/numpy-1.6.2-unicode-python3.3.patch
+++ b/numpy-1.6.2-unicode-python3.3.patch
@@ -52,3 +52,19 @@
else {
PyVoidScalarObject *vobj = (PyVoidScalarObject *)obj;
vobj->base = NULL;
+diff --git numpy/core/src/multiarray/scalartypes.c.src numpy/core/src/multiarray/scalartypes.c.src
+index e547071..12745d7 100644
+--- numpy/core/src/multiarray/scalartypes.c.src
++++ numpy/core/src/multiarray/scalartypes.c.src
+@@ -2592,7 +2592,11 @@ finish:
+ *((npy_ at name@ *)dest) = *((npy_ at name@ *)src);
+ #elif @default@ == 1 /* unicode and strings */
+ if (itemsize == 0) { /* unicode */
++#if PY_VERSION_HEX >= 0x03030000
++ itemsize = PyUnicode_GetLength(robj) * PyUnicode_KIND(robj);
++#else
+ itemsize = ((PyUnicodeObject *)robj)->length * sizeof(Py_UNICODE);
++#endif
+ }
+ memcpy(dest, src, itemsize);
+ /* @default@ == 2 won't get here */
diff --git a/numpy.spec b/numpy.spec
index 081d539..e14bc69 100644
--- a/numpy.spec
+++ b/numpy.spec
@@ -23,6 +23,7 @@ Source0: http://downloads.sourceforge.net/numpy/%{name}-%{version}%{?relc
# Merge: fd15162 f2ac38f
# Author: Travis E. Oliphant <teoliphant at gmail.com>
# Date: Fri Aug 3 22:46:21 2012 -0700
+# and commit a9d58ab42da8d2ed9071044848a54c5e066b557a
Patch0: numpy-1.6.2-unicode-python3.3.patch
BuildRoot: %{_tmppath}/%{name}-%{version}-%{release}-root-%(%{__id_u} -n)
More information about the scm-commits
mailing list