[Scipy-tickets] [SciPy] #1858: test_mio.test_func_read test fails on big endian

SciPy Trac scipy-tickets@scipy....
Fri Mar 1 18:26:24 CST 2013

#1858: test_mio.test_func_read test fails on big endian
 Reporter:  jtaylor  |       Owner:  somebody   
     Type:  defect   |      Status:  new        
 Priority:  normal   |   Milestone:  Unscheduled
Component:  Other    |     Version:  devel      
 Keywords:           |  
 test_mio.test_func_read test fails on big endian with python3.3 (see
 ubuntu build log [0])

 the test data is little endian, and the relevant parts of mio5_utils.pyx
 look like this:

 819         arr = np.array(uc_str, dtype='U')
 822         return np.ndarray(shape=header.dims,
 823                           dtype=self.U1_dtype,
 824                           buffer=arr,
 825                           order='F')
 (same in line 792)

 uc_str is correctly decoded because its ascii (if its not the decoding
 might already fail, which is another issue)

 so arr is now a native >U(big endian) array, self.U1_dtype on the other
 hand is <U1(little endian) as the file is little endian.
 the array returned is garbage.

 I didn't verify it with 0.12 but I saw no relevant code changes in git.

 [0] https://launchpad.net/ubuntu/+source/python-

Ticket URL: <http://projects.scipy.org/scipy/ticket/1858>
SciPy <http://www.scipy.org>
SciPy is open-source software for mathematics, science, and engineering.

More information about the Scipy-tickets mailing list