Adds test for and fixes #134.  This should provide resonably sensible behavior when assigning unicode strings to a header.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1564 ed100bfc-0583-0410-97f2-c26b58777a21
Fixed a couple issues that were failing on Python 3: _ColumnFormat objects need to be smarter about how they're hashed.  KeyError exceptions don't have .message attributes anymore.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1565 ed100bfc-0583-0410-97f2-c26b58777a21
Fixed #146 in the manner specified in the ticket, by adding a new global
variable.

Writing a test for this gave me an opportunity to slightly rethink how
whitespace is currently handled, and streamline things a bit so that it's
handled more consistently.  Now, if you manually assign a value to a header
containing trailing whitespace, that whitespace is treated as intentional and
is *preserved* when writing the file::

    >>> h['FOO'] = 'Bar        '
    >>> print h.cards['FOO']
    FOO     = 'Bar        '

However, when accessing the value through the header the whitespace is still
stripped like normal::

    >>> h['FOO']
    'Bar'

This is the same as though the value had been read directly from a file::

    >>> c = pyfits.Card.fromstring("FOO     = 'Bar        '")
    >>> c.value
    'Bar        '
    >>> h = pyfits.Header()
    >>> h.append(c)
    >>> h['FOO']
    'Bar'

This is unless of course ``pyfits.STRIP_HEADER_WHITESPACE = False``.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1566 ed100bfc-0583-0410-97f2-c26b58777a21
Adds a regression test for #150 and what should be a fix too.  Still need to test this with tweakreg--the real world case where this problem cropped up.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1575 ed100bfc-0583-0410-97f2-c26b58777a21
The previous fix didn't have it quite right.  It still didn't handle multi-extension FITS files very well.  For extensions that haven't been modified and are just being copied, it's still necessary to update the locations of their header and data to reflect the reality of the new file they're being written to.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1576 ed100bfc-0583-0410-97f2-c26b58777a21
Eliminate the HDUList's responsibility for updating each HDU's hdrLoc, datLoc, and datSpan when the file is being resized; that's now the responsibility of the HDU's _writeto method, which makes more sense, and also makes for a good integrity check for other _writeto use cases (even when not resizing).

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1577 ed100bfc-0583-0410-97f2-c26b58777a21
Added a simple .coveragerc file and a couple exclusions.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1581 ed100bfc-0583-0410-97f2-c26b58777a21
Fix a bug in report different image dimensions; added testing for the report output

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1582 ed100bfc-0583-0410-97f2-c26b58777a21
Python < 2.7 doesn't support passing the stream as a keyword argument--only as a positional argument.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1584 ed100bfc-0583-0410-97f2-c26b58777a21
Make ignore_keywords and all other keyword comparisons case-insensitve.  That may not work for some HIERARCH keywords, which are allowed to be case-sensitive.  Need to fix that at some point, but not a priority.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1588 ed100bfc-0583-0410-97f2-c26b58777a21
Added a test for converting a string to an HDU, which isn't well tested at this point.  It almost works, but I'm having some trouble gettin the headers to match up still.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1590 ed100bfc-0583-0410-97f2-c26b58777a21
The first HDU of that file has no data.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1591 ed100bfc-0583-0410-97f2-c26b58777a21
Progress in handling how an input header to the HDU __init__ is merged with the minimum default header.  (also better handling of blank cards in Header.extend--competely blank cards should just be preserved as-is.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1592 ed100bfc-0583-0410-97f2-c26b58777a21
Creating an HDU from a string/buffer much improved--in that it actually works now.  Expanded the test a *little* bit to ensure it works.  More testing could be used but so far so good.  When creating from a string, the HDU has an underlying _buffer attribute containing a reference to the original data buffer in memory, much as the _file attribute references the file backing an HDU.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1593 ed100bfc-0583-0410-97f2-c26b58777a21
Add a regression test for the forthcoming HDUList.fromstring method

Finished implementing HDUList.fromstring.  Expanded the test for it to test opening and reading files of several different types, which helped locate a few additional bugs.  Still not sure if this is perfect, but it seems good enough for now. It should be emphasized that in addition to strings, this should work with any object that implements the buffer interface, including ndarrays.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1594 ed100bfc-0583-0410-97f2-c26b58777a21
Some changes that I think will be necessary for this to work on Python 3, to handle strings incoming as bytes objects.

This test was failing in Python 3, I think due to a Numpy bug related to dtypes but I'm not sure--doing a column by column comparison for tables gets around it.

Converting the header to a string here was causing problems on Python 3, since str() no longer returns an object that implements the buffer interface.  Still need to think about smoothing that out a bit.  But in the meantime, the str() call was unnecessary since _BaseHDU.fromstring can take a Header object already.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1595 ed100bfc-0583-0410-97f2-c26b58777a21
Added a changelog entry for this fix.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1596 ed100bfc-0583-0410-97f2-c26b58777a21
Improved/streamlined how indentation of different sections of diff reports are handled.  Improved reporting of different data values for table columns that contain array values.  Plus a few other miscellaneous report formatting bugs.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1597 ed100bfc-0583-0410-97f2-c26b58777a21
Fixed a typo in the previous commit that caused a crash when comparing header values.  Fixed another issue where diffing the data after diffing the headers could cause the headers to change if the data was scaled--mitigated by keeping a copy of the headers before the data is accessed.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1598 ed100bfc-0583-0410-97f2-c26b58777a21
Adds a test for and fixes the remaining issues in #148.  I think now that checksums will be handled a little more cleanly and less surprisingly.

git-svn-id: http://svn6.assembla.com/svn/pyfits/trunk@1599 ed100bfc-0583-0410-97f2-c26b58777a21