[Scipy-tickets] [SciPy] #1314: import scipy.sparse.sparsetools causes consistent exit code 0

SciPy Trac scipy-tickets@scipy....
Wed Sep 21 01:55:38 CDT 2011

#1314: import scipy.sparse.sparsetools causes consistent exit code 0
 Reporter:  markMiscavage              |       Owner:  wnbell     
     Type:  defect                     |      Status:  new        
 Priority:  normal                     |   Milestone:  Unscheduled
Component:  scipy.sparse               |     Version:  0.8.0      
 Keywords:  sparsetools exit code pyd  |  

Comment(by SteveDoyle):

 Digging into the SWIG code (python 2.6, scipy 0.9.0), I found these
 statements (scipy/sparsetools/csr.py)
 fp, pathname, description = imp.find_module('_csr', [dirname(__file__)]) #
 line 15
 _mod = imp.load_module('_csr', fp, pathname, description)                #
 line 22 - causes the bug

 The values for the relevant variables are:
 fp          =  <open file 'C:\Python26\lib\site-
 packages\scipy\sparse\sparsetools\_csr.pyd', mode 'rb' at 0x028EA808>
 pathname    =  C:\Python26\lib\site-
 description =  ('.pyd', 'rb', 3)

 dirname(__file__) =  C:\Python26\lib\site-

 The values seem to be identical (apart from the memory address of fp) when
 importing scipy.weave

 I was wondering about the comment about the default_dir() if the module is
 being loaded from a pickled object...I'm not sure if that's possible.
 # unconditionally append the default dir for auto-generated compiled
 # extension modules, so that pickle.load()s don't fail.
 sys.path.append(default_dir()) # line 359 - scipy/weave/catalog.py - fixes
 the bug

 The default_dir() is:
 default_dir() = c:\users\steve\appdata\local\temp\steve\python26_compiled

 Note there are similar statements in other parts of the SWIG code.

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

More information about the Scipy-tickets mailing list