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_@name@ *)dest) = *((npy_@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 # 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)