Bug 500026 - After importing Scipy.signal get error when exiting an script
After importing Scipy.signal get error when exiting an script
Status: CLOSED CURRENTRELEASE
Product: Fedora
Classification: Fedora
Component: scipy (Show other bugs)
rawhide
x86_64 Linux
low Severity high
: ---
: ---
Assigned To: Jef Spaleta
Fedora Extras Quality Assurance
:
Depends On:
Blocks:
  Show dependency treegraph
 
Reported: 2009-05-10 04:57 EDT by Howard Ning
Modified: 2009-05-15 10:13 EDT (History)
2 users (show)

See Also:
Fixed In Version:
Doc Type: Bug Fix
Doc Text:
Story Points: ---
Clone Of:
Environment:
Last Closed: 2009-05-15 10:12:41 EDT
Type: ---
Regression: ---
Mount Type: ---
Documentation: ---
CRM:
Verified Versions:
Category: ---
oVirt Team: ---
RHEL 7.3 requirements from Atomic Host:


Attachments (Terms of Use)

  None (edit)
Description Howard Ning 2009-05-10 04:57:40 EDT
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 Jon Ciesla 2009-05-13 10:09:47 EDT
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 Jon Ciesla 2009-05-13 10:11:18 EDT
Hang on, there they are, after I close the python prompt.  One moment. . .
Comment 3 Jon Ciesla 2009-05-13 10:17:55 EDT
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 18:46:33 EDT
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 10:13:17 EDT
I have found that the bug have been fixed in the 0.70-4 release.

Note You need to log in before you can comment on or make changes to this bug.