added universal newlines flag and read-only to file open