in case someone still cares, I uploaded a fix from bug 553496 to lucid-
proposed
** Description changed:
+ TEST CASE:
the following code fails for me if the output file already exists:
-
- >>> import pyfits
- >>> pyfits.PrimaryHDU().writeto('Map.fits', clobber='True')
+ >>> import pyfits
+ >>> pyfits.PrimaryHDU().writeto('Map.fits', clobber='True')
- /var/lib/python-support/python2.6/pyfits/NP_pyfits.py:4895:
- DeprecationWarning: functions overriding warnings.showwarning() must
- support the 'line' argument
- warnings.warn( "Overwrite existing file '%s'." % name)
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line
- 1483, in writeto
- classExtensions=classExtensions)
- File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line
- 4895, in writeto
- warnings.warn( "Overwrite existing file '%s'." % name)
- File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line 76,
- in showwarning
- _showwarning(message, category, filename, lineno, file)
- File "/usr/lib/python2.6/warnings.py", line 29, in _show_warning
- file.write(formatwarning(message, category, filename, lineno, line))
- TypeError: formatwarning() takes exactly 4 arguments (5 given)
+ /var/lib/python-support/python2.6/pyfits/NP_pyfits.py:4895:
+ DeprecationWarning: functions overriding warnings.showwarning() must
+ support the 'line' argument
+ warnings.warn( "Overwrite existing file '%s'." % name)
+ Traceback (most recent call last):
+ File "<stdin>", line 1, in <module>
+ File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line
+ 1483, in writeto
+ classExtensions=classExtensions)
+ File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line
+ 4895, in writeto
+ warnings.warn( "Overwrite existing file '%s'." % name)
+ File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line 76,
+ in showwarning
+ _showwarning(message, category, filename, lineno, file)
+ File "/usr/lib/python2.6/warnings.py", line 29, in _show_warning
+ file.write(formatwarning(message, category, filename, lineno, line))
+ TypeError: formatwarning() takes exactly 4 arguments (5 given)
This happens on Ubuntu 9.04 with python 2.6.2 and pyfits 1.3-2.
I contacted the pyfits author and go the answer that pyfits 1.3 is not
compatible with python 2.6.
So, probably it would be the best to update the pyfits in the repository
with a current version?
Fedora Linux had the same problem, see
https://bugzilla.redhat.com/show_bug.cgi?id=509203
From there I got the following additional info:
This bug was fixed upstream in pyfits version 2.1. See the CHANGELOG
here:
http://www.stsci.edu/resources/software_hardware/pyfits/release
See this scipy mailing list thread:
http://mail.scipy.org/pipermail/astropy/2009-June/000827.html
+
+ REGRESSION POTENTIAL:
+ simple fix to the 2.6 api of the warnings module, should not break anything.
** Description changed:
TEST CASE:
the following code fails for me if the output file already exists:
>>> import pyfits
+ >>> pyfits.PrimaryHDU().writeto('Map.fits', clobber='True')
>>> pyfits.PrimaryHDU().writeto('Map.fits', clobber='True')
/var/lib/python-support/python2.6/pyfits/NP_pyfits.py:4895:
DeprecationWarning: functions overriding warnings.showwarning() must
support the 'line' argument
warnings.warn( "Overwrite existing file '%s'." % name)
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line
1483, in writeto
classExtensions=classExtensions)
File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line
4895, in writeto
warnings.warn( "Overwrite existing file '%s'." % name)
File "/var/lib/python-support/python2.6/pyfits/NP_pyfits.py", line 76,
in showwarning
_showwarning(message, category, filename, lineno, file)
File "/usr/lib/python2.6/warnings.py", line 29, in _show_warning
file.write(formatwarning(message, category, filename, lineno, line))
TypeError: formatwarning() takes exactly 4 arguments (5 given)
- This happens on Ubuntu 9.04 with python 2.6.2 and pyfits 1.3-2.
+ This happens on Ubuntu 10.04 with python 2.6.2 and pyfits 1.3-2.
+
+
+ REGRESSION POTENTIAL:
+ simple fix to the 2.6 api of the warnings module, should not break anything.
+
+
+ original report:
I contacted the pyfits author and go the answer that pyfits 1.3 is not
compatible with python 2.6.
So, probably it would be the best to update the pyfits in the repository
with a current version?
Fedora Linux had the same problem, see
https://bugzilla.redhat.com/show_bug.cgi?id=509203
From there I got the following additional info:
This bug was fixed upstream in pyfits version 2.1. See the CHANGELOG
here:
http://www.stsci.edu/resources/software_hardware/pyfits/release
See this scipy mailing list thread:
http://mail.scipy.org/pipermail/astropy/2009-June/000827.html
-
- REGRESSION POTENTIAL:
- simple fix to the 2.6 api of the warnings module, should not break anything.
--
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.
https://bugs.launchpad.net/bugs/432459
Title:
"clobber" fails when writing files
To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/pyfits/+bug/432459/+subscriptions
--
ubuntu-bugs mailing list
[email protected]
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs