if newline != line:
            if g is None:
                try:
                    g = open(tempname, 'w')
                except IOError, msg: