Bug 500026 - After importing Scipy.signal get error when exiting an script
Summary: After importing Scipy.signal get error when exiting an script
Keywords:
Status: CLOSED CURRENTRELEASE
Alias: None
Product: Fedora
Classification: Fedora
Component: scipy
Version: rawhide
Hardware: x86_64
OS: Linux
low
high
Target Milestone: ---
Assignee: Jef Spaleta
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks:
TreeView+ depends on / blocked
 
Reported: 2009-05-10 08:57 UTC by Howard Ning
Modified: 2009-05-15 14:13 UTC (History)
2 users (show)

Fixed In Version:
Clone Of:
Environment:
Last Closed: 2009-05-15 14:12:41 UTC
Type: ---
Embargoed:


Attachments (Terms of Use)

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.


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