Bug 500026

Summary: After importing Scipy.signal get error when exiting an script
Product: [Fedora] Fedora Reporter: Howard Ning <mrlhwliberty>
Component: scipyAssignee: Jef Spaleta <jspaleta>
Status: CLOSED CURRENTRELEASE QA Contact: Fedora Extras Quality Assurance <extras-qa>
Severity: high Docs Contact:
Priority: low    
Version: rawhideCC: gwync, jspaleta
Target Milestone: ---   
Target Release: ---   
Hardware: x86_64   
OS: Linux   
Whiteboard:
Fixed In Version: Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of: Environment:
Last Closed: 2009-05-15 14:12:41 UTC Type: ---
Regression: --- Mount Type: ---
Documentation: --- CRM:
Verified Versions: Category: ---
oVirt Team: --- RHEL 7.3 requirements from Atomic Host:
Cloudforms Team: --- Target Upstream Version:
Embargoed:

Description Howard Ning 2009-05-10 08:57:40 UTC
Description of problem:
If I import scipy.signal, then I will get an error after exiting
For example I have a script:

import scipy.signal
(b, a) = scipy.signal.iirfilter(4, Wn = [0.2,0.3])

Then I run the program, it gets an error:
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
RuntimeError: more argument specifiers than keyword list entries (remaining format:'|:convolve.destroy_convolve_cache')
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
RuntimeError: more argument specifiers than keyword list entries (remaining format:'|:_fftpack.destroy_drfft_cache')
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
RuntimeError: more argument specifiers than keyword list entries (remaining format:'|:_fftpack.destroy_zfftnd_cache')
Error in atexit._run_exitfuncs:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
RuntimeError: more argument specifiers than keyword list entries (remaining format:'|:_fftpack.destroy_zfft_cache')
Error in sys.exitfunc:
Traceback (most recent call last):
  File "/usr/lib64/python2.6/atexit.py", line 24, in _run_exitfuncs
    func(*targs, **kargs)
RuntimeError: more argument specifiers than keyword list entries (remaining format:'|:_fftpack.destroy_zfft_cache')


Version-Release number of selected component (if applicable):
0.7.0
.2.fc11

How reproducible:
Run the scipt with "import scipy.signal".
Then It will get error

Steps to Reproduce:
1. run script with "import scipy.signal"
2. run script
3.
  
Actual results:
It pops an error

Expected results:
With no error

Additional info:

Comment 1 Gwyn Ciesla 2009-05-13 14:09:47 UTC
I can't confirm this on current rawhide 32-bit with matching scipy version.  at a python prompt I typed import scipy.signal and got no errors.  Can you still reproduce this?

Comment 2 Gwyn Ciesla 2009-05-13 14:11:18 UTC
Hang on, there they are, after I close the python prompt.  One moment. . .

Comment 3 Gwyn Ciesla 2009-05-13 14:17:55 UTC
I thought adding numpy-f2py, which scipy will require in it's next build, would fix this, but it doesn't.

Comment 4 Howard Ning 2009-05-13 22:46:33 UTC
First I would say, you need to write a .py script with it.
The best way is to use the tesing cases in scipy:
$python /usr/lib64/python2.6/site-packages/scipy/fftpack/tests/test_basic.py

Also, I have found a workaround here, it is a little rough though.

Comment out these lines in /usr/lib64/python2.6/site-packages/scipy/fftpack/basic.py

import atexit
atexit.register(fftpack.destroy_zfft_cache)
atexit.register(fftpack.destroy_zfftnd_cache)
atexit.register(fftpack.destroy_drfft_cache)
del atexit

Comment out these lines in 
/usr/lib64/python2.6/site-packages/scipy/fftpack/pseudo_diffs.py
import atexit
atexit.register(convolve.destroy_convolve_cache)
del atexit

You may change the lib64 to lib if using an 32 bit machine. Installing numpy-f2py does not help though.

Comment 5 Howard Ning 2009-05-15 14:13:17 UTC
I have found that the bug have been fixed in the 0.70-4 release.