[NumPy-Tickets] [NumPy] #1756: Segfault when recasting string arrays

NumPy Trac numpy-tickets@scipy....
Sat Mar 5 10:03:39 CST 2011


#1756: Segfault when recasting string arrays
--------------------+-------------------------------------------------------
 Reporter:  faltet  |       Owner:  somebody   
     Type:  defect  |      Status:  new        
 Priority:  normal  |   Milestone:  Unscheduled
Component:  Other   |     Version:  devel      
 Keywords:          |  
--------------------+-------------------------------------------------------

Comment(by charris):

 Between crashes I get


 {{{
 In [2]: arr
 Out[2]:
 array(['1', '12', '123', '1234', '12345'],
       dtype='|S5')

 In [3]: array(arr, dtype="|S3")
 Out[3]:
 array(['1', '\x00\x001', '2', '\x0012', '3'],
       dtype='|S3')

 }}}

 Which looks like the conversion is just reading three bytes at a time from
 the original contiguous data. I'll guess that the copying is of the whole
 of the original data, which accounts for the crash, and that the result is
 displayed three bytes at a time.

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


More information about the NumPy-Tickets mailing list