Another minor comment, couldn't this be achieved with `fid.seek(..., os.SEEK_CUR)`? (http://docs.python.org/2/library/stdtypes.html#bltin-file-objects)