[Scipy-tickets] [SciPy] #473: io.mio.loadmat : error loading path containing os.sep in filename

SciPy scipy-tickets@scipy....
Tue Jul 31 05:16:23 CDT 2007


#473: io.mio.loadmat : error loading path containing os.sep in filename
----------------------+-----------------------------------------------------
 Reporter:  Fabricio  |       Owner:  somebody
     Type:  defect    |      Status:  new     
 Priority:  high      |   Milestone:          
Component:  scipy.io  |     Version:          
 Severity:  critical  |    Keywords:          
----------------------+-----------------------------------------------------
 I do want to separate src files and data files, so that I have a directory
 whose purpose is to store .mat files.
 But loading such files with loadmat, I have a error message using relative
 paths like '../mat/azea.mat' :

 {{{
 Python 2.4.4 (#2, Jul 21 2007, 11:00:24)
 [GCC 4.1.3 20070718 (prerelease) (Debian 4.1.2-14)] on linux2
 Type "help", "copyright", "credits" or "license" for more information.
 >>> import scipy.io
 >>> scipy.io.loadmat('../mat/azea.mat',True,False)
 Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/lib/python2.4/site-packages/scipy/io/mio.py", line 95, in
 loadmat
     MR = mat_reader_factory(file_name, appendmat, **kwargs)
   File "/usr/lib/python2.4/site-packages/scipy/io/mio.py", line 49, in
 mat_reader_factory
     full_name = find_mat_file(file_name, appendmat)
   File "/usr/lib/python2.4/site-packages/scipy/io/mio.py", line 41, in
 find_mat_file
     return full_name
 UnboundLocalError: local variable 'full_name' referenced before assignment

 }}}

 Looking for the code of loadmat function, I saw this mistake :[[BR]]

 - full_file_name is used instead of full_name at line 24

 Patch is attached.

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


More information about the Scipy-tickets mailing list