[NumPy-Tickets] [NumPy] #2066: np.searchsorted segfaults when input is a recarray

NumPy Trac numpy-tickets@scipy....
Sun Feb 26 16:56:37 CST 2012


#2066: np.searchsorted segfaults when input is a recarray
--------------------------------------------------------+-------------------
 Reporter:  josh.ayers                                  |       Owner:  somebody
     Type:  defect                                      |      Status:  new     
 Priority:  normal                                      |   Milestone:  1.6.2   
Component:  numpy.core                                  |     Version:  1.6.1   
 Keywords:  searchsorted, segfault, segmentation fault  |  
--------------------------------------------------------+-------------------

Comment(by charris):

 I suspect this is a problem with recarray. Things work better with array:


 {{{
 In [59]: a = np.array([(2,2),(2,2)], dtype)

 In [60]: a
 Out[60]:
 array([(2, 2), (2, 2)],
       dtype=[('f0', '<i4'), ('f1', '<i4')])

 In [61]: a.searchsorted(1)
 ---------------------------------------------------------------------------
 TypeError                                 Traceback (most recent call
 last)
 /home/charris/<ipython-input-61-0a2b1f19a7e6> in <module>()
 ----> 1 a.searchsorted(1)

 TypeError: invalid type promotion


 }}}

-- 
Ticket URL: <http://projects.scipy.org/numpy/ticket/2066#comment:1>
NumPy <http://projects.scipy.org/numpy>
My example project


More information about the NumPy-Tickets mailing list