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

SciPy Trac scipy-tickets@scipy....
Fri Mar 1 19:29:20 CST 2013


#1858: test_mio.test_func_read test fails on big endian
----------------------+-----------------------------------------------------
 Reporter:  jtaylor   |       Owner:  MatthewBrett
     Type:  defect    |      Status:  new         
 Priority:  normal    |   Milestone:  Unscheduled 
Component:  scipy.io  |     Version:  devel       
 Keywords:            |  
----------------------+-----------------------------------------------------
Changes (by warren.weckesser):

  * owner:  somebody => MatthewBrett
  * component:  Other => scipy.io


Old description:

> 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-
> scipy/0.11.0+dfsg1-1/+build/4337165/+files/buildlog_ubuntu-raring-powerpc
> .python-scipy_0.11.0%2Bdfsg1-1_FAILEDTOBUILD.txt.gz

New description:

 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-
 scipy/0.11.0+dfsg1-1/+build/4337165/+files/buildlog_ubuntu-raring-powerpc
 .python-scipy_0.11.0%2Bdfsg1-1_FAILEDTOBUILD.txt.gz

--

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


More information about the Scipy-tickets mailing list