@mdboom, that's a good point.

What do you think of having this function do all of the type marshaling before populating the WCS data structures, so that the data structure is updated if and only if the function has progressed past the point which any Python exceptions could possibly be raised?