astropy/astropy — pull request #125 by mdboom (2012-01-09 19:41:31+00:00)
Title: Windows compatibility

All tests pass on Windows 7, Python 2.7 (from python.org), Numpy 1.6.1, with the MSVC (Visual Studio Express) 10.0 compiler.

A couple of gotchas here:

configobj expects filenames or file handles opened in binary mode. The weird `LocalPath` objects that py.test gives when you use its `tmpdir` functionality open the files in text mode so things break on Windows. Best to avoid those and pass filenames instead.

Filenames can not be simultaneously opened for reading and writing on Windows, so the `test_checksum` test needed to be modified.

File handles can not be passed to the C level and used directly, like they can on Unix, so on Windows it now passes a `read` method to the C extension, and the C extension calls it through the Python/C API to get bytes from the file.