[NumPy-Tickets] [NumPy] #1578: test_from_unicode crashes on Python 2.7 and Numpy 2.0.0-devel
NumPy Trac
numpy-tickets@scipy....
Mon Apr 9 08:24:13 CDT 2012
#1578: test_from_unicode crashes on Python 2.7 and Numpy 2.0.0-devel
-------------------------+--------------------------------------------------
Reporter: mbudisic | Owner: somebody
Type: defect | Status: reopened
Priority: normal | Milestone: Unscheduled
Component: numpy.core | Version: devel
Resolution: | Keywords:
-------------------------+--------------------------------------------------
Comment(by jmiessner):
Sorry guys, this dropped off my radar. I'm stuck on a behind-schedule
project, so I don't have time to figure out how to use git on Windows. I'm
hoping someone else can manage it for me. The following describes the
differences between numpy 1.6.1 and the fixes I made.[[BR]][[BR]]
I'm not even going to try to fix the original issue - use of the copy-
paste anti-pattern. I had to get this working in a hurry. That's the way
things always are at my company.[[BR]][[BR]]
'''numpy/core/src/multiarray/scalarapi.c:'''
''Fix inconsistency with Python 2.7 at line 701:''
{{{
+ #if PY_VERSION_HEX >= 0x02070000
+ destptr = PyObject_MALLOC(sizeof(Py_UNICODE)*(length+1));
+ #else
destptr = PyMem_NEW(Py_UNICODE,length+1);
+ #endif
}}}
'''numpy/core/src/multiarray/ucsnarrow.c:'''
''Fix inconsistency with Python 2.7 at line 94:''
{{{
+ #if PY_VERSION_HEX >= 0x02070000
+ unicode->str =
PyObject_MALLOC(sizeof(Py_UNICODE)*(size_t)(length+1));
+ #else
unicode->str = PyMem_NEW(Py_UNICODE, length+1);
+ #endif
}}}
'''numpy/core/src/multiarray/ucsnarrow.c:'''
''Fix inconsistency with Python 2.7 at line 117:''
{{{
+ #if PY_VERSION_HEX >= 0x02070000
+ uni->str = PyObject_REALLOC(uni->str,
+ sizeof(Py_UNICODE)*(size_t)(length+1));
+ #else
PyMem_RESIZE(uni->str, Py_UNICODE, length+1);
+ #endif
}}}
--
Ticket URL: <http://projects.scipy.org/numpy/ticket/1578#comment:17>
NumPy <http://projects.scipy.org/numpy>
My example project
More information about the NumPy-Tickets
mailing list