[AstroPy] pyfits does not write to gzip ab+ objects

John K. Parejko john.parejko at yale.edu
Wed Aug 28 16:24:18 EDT 2013


On 27Aug 2013, at 11:49, Erik Bray wrote:

> I think that the gzip module does not actually support 'ab+' mode, and that if 
> you pass that in it gets confused though it doesn't actually give you any useful 
> errors up front.  Essentially 'ab' is a write-only mode, but 'ab+' is 
> read/write, so when you pass in 'ab+' it opens the underlying file object in a 
> read/write mode but the GzipFile itself is write-only.  In think somewhere this 
> incongruity causes problems...

Except that 'ab+' worked just fine with pyfits 2.4 (I don't know which pyfits version first behaved differently). That's why I suspect it's a pyfits change, not a gzip change.

> In this case if you're just writing a new file 'wb' should suffice too.


I'll check up on whether 'ab+' was really necessary for our purposes.

John

--
*************************
John Parejko
john.parejko at yale.edu
http://www.astro.yale.edu/~jp727/
203 432-9759
JWG 465
Department of Physics
Yale University
New Haven, CT
**************************









More information about the AstroPy mailing list