[Scipy-tickets] [SciPy] #1294: loadmat fails "TypeError: buffer is too small for requested array"

SciPy Trac scipy-tickets@scipy....
Mon Oct 4 13:26:15 CDT 2010


#1294: loadmat fails "TypeError: buffer is too small for requested array"
-------------------------+--------------------------------------------------
 Reporter:  pv           |       Owner:  somebody
     Type:  defect       |      Status:  new     
 Priority:  normal       |   Milestone:  0.9.0   
Component:  scipy.io     |     Version:  0.8.0   
 Keywords:  loadmat mat  |  
-------------------------+--------------------------------------------------
 Reported at:
 http://article.gmane.org/gmane.comp.python.scientific.user/26367

 {{{
 >>> import scipy
 >>> import scipy.io
 >>> scipy.__version__
 '0.9.0.dev6827+13b9a9'
 >>> scipy.io.loadmat('20100819125947.mat')
 Traceback (most recent call last):
   File "<stdin>", line 1, in <module>
   File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python2.6/site-
 packages/scipy/io/matlab/mio.py", line 142, in loadmat
     matfile_dict = MR.get_variables()
   File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python2.6/site-
 packages/scipy/io/matlab/mio5.py", line 422, in get_variables
     res = self.read_var_array(hdr, process)
   File "/home/pauli/prj/scipy/scipy/dist/linux/lib/python2.6/site-
 packages/scipy/io/matlab/mio5.py", line 391, in read_var_array
     return self._matrix_reader.array_from_header(header, process)
   File "mio5_utils.pyx", line 596, in
 scipy.io.matlab.mio5_utils.VarReader5.array_from_header
 (scipy/io/matlab/mio5_utils.c:5007)
   File "mio5_utils.pyx", line 643, in
 scipy.io.matlab.mio5_utils.VarReader5.array_from_header
 (scipy/io/matlab/mio5_utils.c:4667)
   File "mio5_utils.pyx", line 838, in
 scipy.io.matlab.mio5_utils.VarReader5.read_struct
 (scipy/io/matlab/mio5_utils.c:6893)
   File "mio5_utils.pyx", line 594, in
 scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix
 (scipy/io/matlab/mio5_utils.c:4260)
   File "mio5_utils.pyx", line 643, in
 scipy.io.matlab.mio5_utils.VarReader5.array_from_header
 (scipy/io/matlab/mio5_utils.c:4667)
   File "mio5_utils.pyx", line 838, in
 scipy.io.matlab.mio5_utils.VarReader5.read_struct
 (scipy/io/matlab/mio5_utils.c:6893)
   File "mio5_utils.pyx", line 594, in
 scipy.io.matlab.mio5_utils.VarReader5.read_mi_matrix
 (scipy/io/matlab/mio5_utils.c:4260)
   File "mio5_utils.pyx", line 637, in
 scipy.io.matlab.mio5_utils.VarReader5.array_from_header
 (scipy/io/matlab/mio5_utils.c:4582)
   File "mio5_utils.pyx", line 746, in
 scipy.io.matlab.mio5_utils.VarReader5.read_char
 (scipy/io/matlab/mio5_utils.c:5726)
 TypeError: buffer is too small for requested array
 }}}

 sample files:

 http://midgewater.twdb.state.tx.us/bays_estuaries/Publications\20100819125947.mat
 (~330KB)

 http://midgewater.twdb.state.tx.us/bays_estuaries/Publications\20100819102442.mat
 (~18mb)

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


More information about the Scipy-tickets mailing list